Changeset 3842a955 in mainline for uspace/lib/c/generic/async.c


Ignore:
Timestamp:
2011-06-19T15:59:42Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
26e7d6d
Parents:
9724d7f (diff), 74464e8 (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.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r9724d7f r3842a955  
    160160       
    161161        /** Messages that should be delivered to this fibril. */
    162         link_t msg_queue;
     162        list_t msg_queue;
    163163       
    164164        /** Identification of the opening call. */
     
    361361        wd->to_event.inlist = true;
    362362       
    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) {
    365365                awaiter_t *cur
    366366                    = list_get_instance(tmp, awaiter_t, to_event.link);
     
    372372        }
    373373       
    374         list_append(&wd->to_event.link, tmp);
     374        list_insert_before(&wd->to_event.link, tmp);
    375375}
    376376
     
    569569        }
    570570       
    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);
    572572        list_remove(&msg->link);
    573573       
     
    675675        while (!list_empty(&fibril_connection->msg_queue)) {
    676676                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);
    679679               
    680680                list_remove(&msg->link);
     
    806806        futex_down(&async_futex);
    807807       
    808         link_t *cur = timeout_list.next;
    809         while (cur != &timeout_list) {
     808        link_t *cur = list_first(&timeout_list);
     809        while (cur != NULL) {
    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;
    817815               
    818816                list_remove(&waiter->to_event.link);
     
    828826                        fibril_add_ready(waiter->fid);
    829827                }
     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(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);
    858858                       
    859859                        struct timeval tv;
     
    17311731                 */
    17321732                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               
    17341736                list_remove(&exch->sess_link);
    17351737                list_remove(&exch->global_link);
     
    17431745                        exch = (async_exch_t *) malloc(sizeof(async_exch_t));
    17441746                        if (exch != NULL) {
    1745                                 list_initialize(&exch->sess_link);
    1746                                 list_initialize(&exch->global_link);
     1747                                link_initialize(&exch->sess_link);
     1748                                link_initialize(&exch->global_link);
    17471749                                exch->sess = sess;
    17481750                                exch->phone = sess->phone;
     
    17611763                                exch = (async_exch_t *) malloc(sizeof(async_exch_t));
    17621764                                if (exch != NULL) {
    1763                                         list_initialize(&exch->sess_link);
    1764                                         list_initialize(&exch->global_link);
     1765                                        link_initialize(&exch->sess_link);
     1766                                        link_initialize(&exch->global_link);
    17651767                                        exch->sess = sess;
    17661768                                        exch->phone = phone;
     
    17741776                                 */
    17751777                                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                               
    17781781                                list_remove(&exch->sess_link);
    17791782                                list_remove(&exch->global_link);
Note: See TracChangeset for help on using the changeset viewer.