Changeset 953769f in mainline for uspace/lib/libc/generic/async.c
- Timestamp:
- 2009-06-15T21:51:50Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 103e7d7
- Parents:
- ef8bcc6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/async.c
ref8bcc6 r953769f 179 179 static void default_client_connection(ipc_callid_t callid, ipc_call_t *call); 180 180 static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call); 181 static void default_pending(void);182 181 183 182 /** … … 191 190 */ 192 191 static async_client_conn_t interrupt_received = default_interrupt_received; 193 194 /**195 * Pointer to a fibril function that will be used to handle pending196 * operations.197 */198 static async_pending_t pending = default_pending;199 192 200 193 static hash_table_t conn_hash_table; … … 376 369 377 370 fid_t fid = fibril_create(notification_fibril, msg); 378 fibril_add_ready(fid);379 380 futex_up(&async_futex);381 return true;382 }383 384 /** Pending fibril.385 *386 * After each call the pending operations are executed in a separate387 * fibril. The function pending() is c.388 *389 * @param arg Unused.390 *391 * @return Always zero.392 *393 */394 static int pending_fibril(void *arg)395 {396 pending();397 398 return 0;399 }400 401 /** Process pending actions.402 *403 * A new fibril is created which would process the pending operations.404 *405 * @return False if an error occured.406 * True if the execution was passed to the pending fibril.407 *408 */409 static bool process_pending(void)410 {411 futex_down(&async_futex);412 413 fid_t fid = fibril_create(pending_fibril, NULL);414 371 fibril_add_ready(fid); 415 372 … … 514 471 } 515 472 516 /** Default fibril function that gets called to handle pending operations.517 *518 * This function is defined as a weak symbol - to be redefined in user code.519 *520 */521 static void default_pending(void)522 {523 }524 525 473 /** Wrapper for client connection fibril. 526 474 * … … 661 609 662 610 out: 663 process_pending();611 ; 664 612 } 665 613 … … 1050 998 } 1051 999 1052 /** Setter for pending function pointer.1053 *1054 * @param pend Function that will implement a new pending1055 * operations fibril.1056 */1057 void async_set_pending(async_pending_t pend)1058 {1059 pending = pend;1060 }1061 1062 1000 /** Pseudo-synchronous message sending - fast version. 1063 1001 *
Note:
See TracChangeset
for help on using the changeset viewer.