Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    r3815efb r9934f7d  
    160160       
    161161        /** Messages that should be delivered to this fibril. */
    162         list_t msg_queue;
     162        link_t msg_queue;
    163163       
    164164        /** Identification of the opening call. */
     
    213213 * This function is defined as a weak symbol - to be redefined in user code.
    214214 *
    215  * @param callid Hash of the incoming call.
    216  * @param call   Data of the incoming call.
    217  * @param arg    Local argument
     215 * @param callid        Hash of the incoming call.
     216 * @param call          Data of the incoming call.
     217 * @param arg           Local argument
    218218 *
    219219 */
     
    228228 * This function is defined as a weak symbol - to be redefined in user code.
    229229 *
    230  * @param callid Hash of the incoming call.
    231  * @param call   Data of the incoming call.
    232  * @param arg    Local argument.
     230 * @param callid        Hash of the incoming call.
     231 * @param call          Data of the incoming call.
     232 * @param arg           Local argument.
    233233 *
    234234 */
     
    361361        wd->to_event.inlist = true;
    362362       
    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) {
    365365                awaiter_t *cur
    366366                    = list_get_instance(tmp, awaiter_t, to_event.link);
     
    372372        }
    373373       
    374         list_insert_before(&wd->to_event.link, tmp);
     374        list_append(&wd->to_event.link, tmp);
    375375}
    376376
     
    569569        }
    570570       
    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);
    572572        list_remove(&msg->link);
    573573       
     
    675675        while (!list_empty(&fibril_connection->msg_queue)) {
    676676                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);
    679679               
    680680                list_remove(&msg->link);
     
    709709 * @param cfibril       Fibril function that should be called upon opening the
    710710 *                      connection.
    711  * @param carg          Extra argument to pass to the connection fibril
     711 * @param carg          Extra argument to pass to the connection fibril
    712712 *
    713713 * @return New fibril id or NULL on failure.
     
    806806        futex_down(&async_futex);
    807807       
    808         link_t *cur = list_first(&timeout_list);
    809         while (cur != NULL) {
     808        link_t *cur = timeout_list.next;
     809        while (cur != &timeout_list) {
    810810                awaiter_t *waiter =
    811811                    list_get_instance(cur, awaiter_t, to_event.link);
     
    813813                if (tv_gt(&waiter->to_event.expires, &tv))
    814814                        break;
     815               
     816                cur = cur->next;
    815817               
    816818                list_remove(&waiter->to_event.link);
     
    826828                        fibril_add_ready(waiter->fid);
    827829                }
    828                
    829                 cur = list_first(&timeout_list);
    830830        }
    831831       
     
    854854                suseconds_t timeout;
    855855                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);
    858858                       
    859859                        struct timeval tv;
     
    17311731                 */
    17321732                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);
    17361734                list_remove(&exch->sess_link);
    17371735                list_remove(&exch->global_link);
     
    17451743                        exch = (async_exch_t *) malloc(sizeof(async_exch_t));
    17461744                        if (exch != NULL) {
    1747                                 link_initialize(&exch->sess_link);
    1748                                 link_initialize(&exch->global_link);
     1745                                list_initialize(&exch->sess_link);
     1746                                list_initialize(&exch->global_link);
    17491747                                exch->sess = sess;
    17501748                                exch->phone = sess->phone;
     
    17631761                                exch = (async_exch_t *) malloc(sizeof(async_exch_t));
    17641762                                if (exch != NULL) {
    1765                                         link_initialize(&exch->sess_link);
    1766                                         link_initialize(&exch->global_link);
     1763                                        list_initialize(&exch->sess_link);
     1764                                        list_initialize(&exch->global_link);
    17671765                                        exch->sess = sess;
    17681766                                        exch->phone = phone;
     
    17761774                                 */
    17771775                                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);
    17811778                                list_remove(&exch->sess_link);
    17821779                                list_remove(&exch->global_link);
Note: See TracChangeset for help on using the changeset viewer.