Changeset 7064e71 in mainline
- Timestamp:
- 2025-03-06T14:35:29Z (3 days ago)
- Children:
- 25ee7ec5
- Parents:
- 9a41e6e
- git-author:
- Matěj Volf <git@…> (2025-03-05 23:09:43)
- git-committer:
- Matěj Volf <git@…> (2025-03-06 14:35:29)
- Location:
- uspace
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/libc.c
r9a41e6e r7064e71 81 81 main_fibril.tcb = tls_make_initial(__progsymbols.elfstart); 82 82 } 83 main_fibril.is_freeable = false; 83 84 84 85 assert(main_fibril.tcb); … … 172 173 void __libc_exit(int status) 173 174 { 174 // TODO: some teardown of the main fibril? 175 // namely, fibril_exit_hooks would like to run even on the main fibril 175 fibril_run_exit_hooks(&main_fibril); 176 176 177 177 /* -
uspace/lib/c/generic/private/fibril.h
r9a41e6e r7064e71 94 94 extern void fibril_ipc_poke(void); 95 95 96 extern void fibril_run_exit_hooks(fibril_t *); 97 96 98 /** 97 99 * "Restricted" fibril mutex. -
uspace/lib/c/generic/thread/fibril.c
r9a41e6e r7064e71 199 199 if (fibril->is_freeable) { 200 200 tls_free(fibril->tcb); 201 list_foreach_safe(fibril->exit_hooks, cur, _next) {202 fibril_hook_t *hook = list_get_instance(cur, fibril_hook_t, link);203 free(hook);204 }205 201 free(fibril); 206 202 } … … 850 846 } 851 847 848 void fibril_run_exit_hooks(fibril_t *f) 849 { 850 list_foreach_safe(f->exit_hooks, cur, _next) { 851 fibril_hook_t *hook = list_get_instance(cur, fibril_hook_t, link); 852 list_remove(cur); 853 hook->func(); 854 free(hook); 855 } 856 } 857 852 858 /** 853 859 * Exit a fibril. Never returns. … … 860 866 (void) retval; 861 867 862 list_foreach(fibril_self()->exit_hooks, link, fibril_hook_t, hook) { 863 hook->func(); 864 } 868 fibril_run_exit_hooks(fibril_self()); 865 869 866 870 fibril_t *f = _ready_list_pop_nonblocking(false); -
uspace/lib/posix/src/pthread/keys.c
r9a41e6e r7064e71 104 104 { 105 105 /* 106 * FIXME: this can cause a data race with another fibrill107 * run ning on_fibril_exit. The obvious solution is to add108 * a rwlock on the destructors array, which will be needed109 * anyway if we want tosupport unlimited number of keys.106 * FIXME: this can cause a data race if another fibrill concurrently 107 * runs on_fibril_exit. The obvious solution is to add a rwlock on 108 * the destructors array, which will be needed anyway if we want to 109 * support unlimited number of keys. 110 110 */ 111 111 destructors[key] = NULL; -
uspace/srv/loader/main.c
r9a41e6e r7064e71 355 355 DPRINTF("Jump to entry point at %p\n", pcb.entry); 356 356 357 // mvolfik is very confused: why is __libc_fini called BEFORE jumping to entrypoint??358 357 __libc_fini(); 359 358 __tcb_reset();
Note:
See TracChangeset
for help on using the changeset viewer.