Changeset ab6edb6 in mainline for uspace/lib/c/generic/async
- Timestamp:
- 2018-06-26T17:34:48Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e768aea
- Parents:
- b59318e
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-25 19:28:19)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-06-26 17:34:48)
- Location:
- uspace/lib/c/generic/async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async/client.c
rb59318e rab6edb6 372 372 373 373 /* Leave the async_futex locked when entering this function */ 374 fibril_switch(FIBRIL_TO_MANAGER); 375 376 /* Futex is up automatically after fibril_switch */ 374 fibril_switch(FIBRIL_FROM_BLOCKED); 375 futex_unlock(&async_futex); 377 376 378 377 done: … … 445 444 446 445 /* Leave the async_futex locked when entering this function */ 447 fibril_switch(FIBRIL_TO_MANAGER); 448 449 /* Futex is up automatically after fibril_switch */ 446 fibril_switch(FIBRIL_FROM_BLOCKED); 447 futex_unlock(&async_futex); 450 448 451 449 if (!msg->done) … … 511 509 512 510 /* Leave the async_futex locked when entering this function */ 513 fibril_switch(FIBRIL_TO_MANAGER); 514 515 /* Futex is up automatically after fibril_switch() */ 511 fibril_switch(FIBRIL_FROM_BLOCKED); 512 futex_unlock(&async_futex); 516 513 } 517 514 -
uspace/lib/c/generic/async/server.c
rb59318e rab6edb6 997 997 * case, route_call() will perform the wakeup. 998 998 */ 999 fibril_switch(FIBRIL_TO_MANAGER); 1000 1001 /* 1002 * Futex is up after getting back from async_manager. 1003 * Get it again. 1004 */ 1005 futex_lock(&async_futex); 999 fibril_switch(FIBRIL_FROM_BLOCKED); 1000 1006 1001 if ((usecs) && (conn->wdata.to_event.occurred) && 1007 1002 (list_empty(&conn->msg_queue))) { … … 1143 1138 { 1144 1139 while (true) { 1145 if (fibril_switch(FIBRIL_FROM_MANAGER)) {1146 futex_unlock(&async_futex);1147 /*1148 * async_futex is always held when entering a manager1149 * fibril.1150 */1151 continue;1152 }1153 1154 1140 futex_lock(&async_futex); 1141 fibril_switch(FIBRIL_FROM_MANAGER); 1142 1143 /* 1144 * The switch only returns when there is no non-manager fibril 1145 * it can run. 1146 */ 1155 1147 1156 1148 suseconds_t timeout; … … 1226 1218 static errno_t async_manager_fibril(void *arg) 1227 1219 { 1228 futex_unlock(&async_futex);1229 1230 /*1231 * async_futex is always locked when entering manager1232 */1233 1220 async_manager_worker(); 1234 1235 1221 return 0; 1236 1222 }
Note:
See TracChangeset
for help on using the changeset viewer.