Changeset 2482192 in mainline


Ignore:
Timestamp:
2025-03-05T22:22:36Z (4 days ago)
Author:
Matěj Volf <git@…>
Children:
9a41e6e
Parents:
5208709
git-author:
Matěj Volf <git@…> (2025-01-18 20:57:32)
git-committer:
Matěj Volf <git@…> (2025-03-05 22:22:36)
Message:

fix initialization of fibril.exit_hooks

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/libc.c

    r5208709 r2482192  
    172172void __libc_exit(int status)
    173173{
     174        // TODO: some teardown of the main fibril?
     175        // namely, fibril_exit_hooks would like to run even on the main fibril
     176
    174177        /*
    175178         * GCC extension __attribute__((destructor)),
  • uspace/lib/c/generic/thread/fibril.c

    r5208709 r2482192  
    185185void fibril_setup(fibril_t *f)
    186186{
     187        list_initialize(&f->exit_hooks);
    187188        futex_lock(&fibril_futex);
    188189        list_append(&f->all_link, &fibril_list);
     
    566567        fibril->arg = arg;
    567568
    568         list_initialize(&fibril->exit_hooks);
    569 
    570569        context_create_t sctx = {
    571570                .fn = _fibril_main,
     
    934933                return ENOMEM;
    935934
     935        DPRINTF("adding exit hook: function %p (fibril_hook_t structure at %p)\n", hook, h);
     936
    936937        h->func = hook;
    937938        list_append(&h->link, &fibril_self()->exit_hooks);
  • uspace/srv/loader/main.c

    r5208709 r2482192  
    355355        DPRINTF("Jump to entry point at %p\n", pcb.entry);
    356356
     357        // mvolfik is very confused: why is __libc_fini called BEFORE jumping to entrypoint??
    357358        __libc_fini();
    358359        __tcb_reset();
Note: See TracChangeset for help on using the changeset viewer.