Changeset a46da63 in mainline for libc/generic/async.c
- Timestamp:
- 2006-06-16T20:50:51Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 153a209
- Parents:
- b34fab6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/async.c
rb34fab6 ra46da63 27 27 */ 28 28 29 29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 374 374 PS_connection = (connection_t *)arg; 375 375 PS_connection->cthread(PS_connection->callid, &PS_connection->call); 376 376 377 /* Remove myself from connection hash table */ 377 378 futex_down(&async_futex); … … 379 380 hash_table_remove(&conn_hash_table, &key, 1); 380 381 futex_up(&async_futex); 382 381 383 /* Answer all remaining messages with ehangup */ 382 384 while (!list_empty(&PS_connection->msg_queue)) { … … 390 392 if (PS_connection->close_callid) 391 393 ipc_answer_fast(PS_connection->close_callid, 0, 0, 0); 394 395 return 0; 392 396 } 393 397 … … 406 410 * @return New thread id 407 411 */ 408 pstid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid, 409 ipc_call_t *call, 410 void (*cthread)(ipc_callid_t,ipc_call_t *)) 411 { 412 pstid_t ptid; 412 pstid_t async_new_connection(ipcarg_t in_phone_hash,ipc_callid_t callid, ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *)) 413 { 413 414 connection_t *conn; 414 415 unsigned long key; … … 515 516 while (1) { 516 517 if (psthread_schedule_next_adv(PS_FROM_MANAGER)) { 517 futex_up(&async_futex); /* async_futex is always held 518 * when entering manager thread 519 */ 518 futex_up(&async_futex); 519 /* async_futex is always held 520 * when entering manager thread 521 */ 520 522 continue; 521 523 } … … 547 549 handle_call(callid, &call); 548 550 } 551 552 return 0; 549 553 } 550 554 … … 558 562 static int async_manager_thread(void *arg) 559 563 { 560 futex_up(&async_futex); /* async_futex is always locked when entering 561 * manager */ 564 futex_up(&async_futex); 565 /* async_futex is always locked when entering 566 * manager */ 562 567 async_manager_worker(); 568 569 return 0; 563 570 } 564 571 … … 586 593 } 587 594 595 return 0; 588 596 } 589 597 … … 680 688 { 681 689 amsg_t *msg = (amsg_t *) amsgid; 682 connection_t *conn;683 690 684 691 futex_down(&async_futex); … … 712 719 { 713 720 amsg_t *msg = (amsg_t *) amsgid; 714 connection_t *conn;715 721 716 722 /* TODO: Let it go through the event read at least once */ … … 803 809 804 810 805 /** @} 806 */ 807 808 811 /** @} 812 */
Note:
See TracChangeset
for help on using the changeset viewer.