Changes in uspace/lib/c/generic/async.c [3815efb:9934f7d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async.c
r3815efb r9934f7d 160 160 161 161 /** Messages that should be delivered to this fibril. */ 162 li st_t msg_queue;162 link_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. head.next;364 while (tmp != &timeout_list .head) {363 link_t *tmp = timeout_list.next; 364 while (tmp != &timeout_list) { 365 365 awaiter_t *cur 366 366 = list_get_instance(tmp, awaiter_t, to_event.link); … … 372 372 } 373 373 374 list_ insert_before(&wd->to_event.link, tmp);374 list_append(&wd->to_event.link, tmp); 375 375 } 376 376 … … 569 569 } 570 570 571 msg_t *msg = list_get_instance( list_first(&conn->msg_queue), msg_t, link);571 msg_t *msg = list_get_instance(conn->msg_queue.next, 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( list_first(&fibril_connection->msg_queue),678 msg_t,link);677 list_get_instance(fibril_connection->msg_queue.next, msg_t, 678 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 = list_first(&timeout_list);809 while (cur != NULL) {808 link_t *cur = timeout_list.next; 809 while (cur != &timeout_list) { 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; 815 817 816 818 list_remove(&waiter->to_event.link); … … 826 828 fibril_add_ready(waiter->fid); 827 829 } 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( 857 list_first(&timeout_list),awaiter_t, to_event.link);856 awaiter_t *waiter = list_get_instance(timeout_list.next, 857 awaiter_t, to_event.link); 858 858 859 859 struct timeval tv; … … 1731 1731 */ 1732 1732 exch = (async_exch_t *) 1733 list_get_instance(list_first(&sess->exch_list), 1734 async_exch_t, sess_link); 1735 1733 list_get_instance(sess->exch_list.next, async_exch_t, sess_link); 1736 1734 list_remove(&exch->sess_link); 1737 1735 list_remove(&exch->global_link); … … 1745 1743 exch = (async_exch_t *) malloc(sizeof(async_exch_t)); 1746 1744 if (exch != NULL) { 1747 li nk_initialize(&exch->sess_link);1748 li nk_initialize(&exch->global_link);1745 list_initialize(&exch->sess_link); 1746 list_initialize(&exch->global_link); 1749 1747 exch->sess = sess; 1750 1748 exch->phone = sess->phone; … … 1763 1761 exch = (async_exch_t *) malloc(sizeof(async_exch_t)); 1764 1762 if (exch != NULL) { 1765 li nk_initialize(&exch->sess_link);1766 li nk_initialize(&exch->global_link);1763 list_initialize(&exch->sess_link); 1764 list_initialize(&exch->global_link); 1767 1765 exch->sess = sess; 1768 1766 exch->phone = phone; … … 1776 1774 */ 1777 1775 exch = (async_exch_t *) 1778 list_get_instance(list_first(&inactive_exch_list), 1779 async_exch_t, global_link); 1780 1776 list_get_instance(inactive_exch_list.next, async_exch_t, 1777 global_link); 1781 1778 list_remove(&exch->sess_link); 1782 1779 list_remove(&exch->global_link);
Note:
See TracChangeset
for help on using the changeset viewer.