Changeset c721d26 in mainline
- Timestamp:
- 2015-06-16T14:18:22Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2654afb
- Parents:
- f7aa7a40
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/fibril.c
rf7aa7a40 rc721d26 96 96 fibril->retval = fibril->func(fibril->arg); 97 97 98 futex_down(&async_futex); 98 99 fibril_switch(FIBRIL_FROM_DEAD); 99 100 /* Not reached */ … … 147 148 /** Switch from the current fibril. 148 149 * 149 * If calling with FIBRIL_TO_MANAGER parameter, the async_futex should be150 * held.150 * If stype is FIBRIL_TO_MANAGER or FIBRIL_FROM_DEAD, the async_futex must 151 * be held. 151 152 * 152 153 * @param stype Switch type. One of FIBRIL_PREEMPT, FIBRIL_TO_MANAGER, … … 163 164 164 165 futex_lock(&fibril_futex); 165 166 166 167 if (stype == FIBRIL_PREEMPT && list_empty(&ready_list)) 167 168 goto ret_0; … … 183 184 /* If we are going to manager and none exists, create it */ 184 185 if ((stype == FIBRIL_TO_MANAGER) || (stype == FIBRIL_FROM_DEAD)) { 186 /* Make sure the async_futex is held. */ 187 assert((atomic_signed_t) async_futex.val.count <= 0); 188 185 189 while (list_empty(&manager_list)) { 186 190 futex_unlock(&fibril_futex); -
uspace/lib/c/include/async.h
rf7aa7a40 rc721d26 108 108 109 109 #define async_manager() \ 110 fibril_switch(FIBRIL_TO_MANAGER) 110 do { \ 111 futex_down(&async_futex); \ 112 fibril_switch(FIBRIL_FROM_DEAD); \ 113 } while (0) 111 114 112 115 #define async_get_call(data) \
Note:
See TracChangeset
for help on using the changeset viewer.