Changeset 25ee7ec5 in mainline for uspace/lib/posix/src/pthread/keys.c
- Timestamp:
- 2025-03-06T14:35:33Z (4 days ago)
- Children:
- af28af6
- Parents:
- 7064e71
- git-author:
- Matěj Volf <git@…> (2025-03-05 23:13:58)
- git-committer:
- Matěj Volf <git@…> (2025-03-06 14:35:33)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/pthread/keys.c
r7064e71 r25ee7ec5 58 58 { 59 59 // initialization is done in setspecific -> if not initialized, nothing was set yet 60 if (!fibril_initialized) return NULL; 60 if (!fibril_initialized) 61 return NULL; 61 62 62 63 assert(key < PTHREAD_KEYS_MAX); … … 67 68 } 68 69 69 static void pthread_key_on_fibril_exit(void) { 70 if (!fibril_initialized) return; 70 static void pthread_key_on_fibril_exit(void) 71 { 72 if (!fibril_initialized) 73 return; 71 74 72 75 for (unsigned i = 0; i < PTHREAD_KEYS_MAX; i++) { … … 78 81 */ 79 82 if (key_data[i] != NULL && destructors[i] != NULL) 80 83 destructors[i](key_data[i]); 81 84 } 82 85 } … … 87 90 DPRINTF("initializing pthread keys\n"); 88 91 errno_t res = fibril_add_exit_hook(pthread_key_on_fibril_exit); 89 if (res != EOK) return res; 92 if (res != EOK) 93 return res; 94 90 95 for (unsigned i = 0; i < PTHREAD_KEYS_MAX; i++) { 91 96 key_data[i] = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.