Changeset c0e674a in mainline for libc/generic/async.c


Ignore:
Timestamp:
2006-05-31T16:15:44Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5052046
Parents:
b27a97bb
Message:

Fix incorrect timeout handling in async framework.
Start tweak the tetris code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libc/generic/async.c

    rb27a97bb rc0e674a  
    165165        return 0;
    166166}
     167static int tv_gteq(struct timeval *tv1, struct timeval *tv2)
     168{
     169        if (tv1->tv_sec > tv2->tv_sec)
     170                return 1;
     171        if (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec >= tv2->tv_usec)
     172                return 1;
     173        return 0;
     174}
    167175
    168176/* Hash table functions */
     
    241249        connection_t *conn;
    242250       
     251        assert(PS_connection);
     252
    243253        futex_down(&async_futex);
    244254
     
    436446                        amsg = list_get_instance(timeout_list.next,amsg_t,link);
    437447                        gettimeofday(&tv,NULL);
    438                         if (tv_gt(&tv, &amsg->expires)) {
     448                        if (tv_gteq(&tv, &amsg->expires)) {
    439449                                handle_expired_timeouts();
    440450                                continue;
     
    589599        while (tmp != &timeout_list) {
    590600                cur = list_get_instance(tmp, amsg_t, link);
    591                 if (tv_gt(&cur->expires, &msg->expires))
     601                if (tv_gteq(&cur->expires, &msg->expires))
    592602                        break;
    593603                tmp = tmp->next;
Note: See TracChangeset for help on using the changeset viewer.