Changeset 7064e71 in mainline for uspace/lib/c/generic/thread/fibril.c
- Timestamp:
- 2025-03-06T14:35:29Z (4 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.