Changeset cac458f in mainline for uspace/lib/c/generic/async.c
- Timestamp:
- 2011-06-22T01:59:39Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 41e2118
- Parents:
- 79506d6 (diff), f1fae414 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async.c
r79506d6 rcac458f 160 160 161 161 /** Messages that should be delivered to this fibril. */ 162 li nk_t msg_queue;162 list_t msg_queue; 163 163 164 164 /** Identification of the opening call. */ … … 213 213 * This function is defined as a weak symbol - to be redefined in user code. 214 214 * 215 * @param callid 216 * @param call 217 * @param arg 215 * @param callid Hash of the incoming call. 216 * @param call Data of the incoming call. 217 * @param arg Local argument 218 218 * 219 219 */ … … 228 228 * This function is defined as a weak symbol - to be redefined in user code. 229 229 * 230 * @param callid 231 * @param call 232 * @param arg 230 * @param callid Hash of the incoming call. 231 * @param call Data of the incoming call. 232 * @param arg Local argument. 233 233 * 234 234 */ … … 361 361 wd->to_event.inlist = true; 362 362 363 link_t *tmp = timeout_list. next;364 while (tmp != &timeout_list ) {363 link_t *tmp = timeout_list.head.next; 364 while (tmp != &timeout_list.head) { 365 365 awaiter_t *cur 366 366 = list_get_instance(tmp, awaiter_t, to_event.link); … … 372 372 } 373 373 374 list_ append(&wd->to_event.link, tmp);374 list_insert_before(&wd->to_event.link, tmp); 375 375 } 376 376 … … 569 569 } 570 570 571 msg_t *msg = list_get_instance( conn->msg_queue.next, msg_t, link);571 msg_t *msg = list_get_instance(list_first(&conn->msg_queue), msg_t, link); 572 572 list_remove(&msg->link); 573 573 … … 675 675 while (!list_empty(&fibril_connection->msg_queue)) { 676 676 msg_t *msg = 677 list_get_instance( fibril_connection->msg_queue.next, msg_t,678 link);677 list_get_instance(list_first(&fibril_connection->msg_queue), 678 msg_t, link); 679 679 680 680 list_remove(&msg->link); … … 709 709 * @param cfibril Fibril function that should be called upon opening the 710 710 * connection. 711 * @param carg 711 * @param carg Extra argument to pass to the connection fibril 712 712 * 713 713 * @return New fibril id or NULL on failure. … … 806 806 futex_down(&async_futex); 807 807 808 link_t *cur = timeout_list.next;809 while (cur != &timeout_list) {808 link_t *cur = list_first(&timeout_list); 809 while (cur != NULL) { 810 810 awaiter_t *waiter = 811 811 list_get_instance(cur, awaiter_t, to_event.link); … … 813 813 if (tv_gt(&waiter->to_event.expires, &tv)) 814 814 break; 815 816 cur = cur->next;817 815 818 816 list_remove(&waiter->to_event.link); … … 828 826 fibril_add_ready(waiter->fid); 829 827 } 828 829 cur = list_first(&timeout_list); 830 830 } 831 831 … … 854 854 suseconds_t timeout; 855 855 if (!list_empty(&timeout_list)) { 856 awaiter_t *waiter = list_get_instance( timeout_list.next,857 awaiter_t, to_event.link);856 awaiter_t *waiter = list_get_instance( 857 list_first(&timeout_list), awaiter_t, to_event.link); 858 858 859 859 struct timeval tv; … … 1731 1731 */ 1732 1732 exch = (async_exch_t *) 1733 list_get_instance(sess->exch_list.next, async_exch_t, sess_link); 1733 list_get_instance(list_first(&sess->exch_list), 1734 async_exch_t, sess_link); 1735 1734 1736 list_remove(&exch->sess_link); 1735 1737 list_remove(&exch->global_link); … … 1743 1745 exch = (async_exch_t *) malloc(sizeof(async_exch_t)); 1744 1746 if (exch != NULL) { 1745 li st_initialize(&exch->sess_link);1746 li st_initialize(&exch->global_link);1747 link_initialize(&exch->sess_link); 1748 link_initialize(&exch->global_link); 1747 1749 exch->sess = sess; 1748 1750 exch->phone = sess->phone; … … 1761 1763 exch = (async_exch_t *) malloc(sizeof(async_exch_t)); 1762 1764 if (exch != NULL) { 1763 li st_initialize(&exch->sess_link);1764 li st_initialize(&exch->global_link);1765 link_initialize(&exch->sess_link); 1766 link_initialize(&exch->global_link); 1765 1767 exch->sess = sess; 1766 1768 exch->phone = phone; … … 1774 1776 */ 1775 1777 exch = (async_exch_t *) 1776 list_get_instance(inactive_exch_list.next, async_exch_t, 1777 global_link); 1778 list_get_instance(list_first(&inactive_exch_list), 1779 async_exch_t, global_link); 1780 1778 1781 list_remove(&exch->sess_link); 1779 1782 list_remove(&exch->global_link);
Note:
See TracChangeset
for help on using the changeset viewer.