Changes in / [f76696f:b8d6783] in mainline


Ignore:
Location:
uspace
Files:
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/Makefile

    rf76696f rb8d6783  
    5050        vfs/vfs1.c \
    5151        ipc/ping_pong.c \
    52         ipc/starve.c \
    5352        loop/loop1.c \
    5453        mm/common.c \
  • uspace/app/tester/tester.c

    rf76696f rb8d6783  
    6060#include "vfs/vfs1.def"
    6161#include "ipc/ping_pong.def"
    62 #include "ipc/starve.def"
    6362#include "loop/loop1.def"
    6463#include "mm/malloc1.def"
  • uspace/app/tester/tester.h

    rf76696f rb8d6783  
    9393extern const char *test_vfs1(void);
    9494extern const char *test_ping_pong(void);
    95 extern const char *test_starve_ipc(void);
    9695extern const char *test_loop1(void);
    9796extern const char *test_malloc1(void);
  • uspace/lib/c/generic/async.c

    rf76696f rb8d6783  
    249249static void to_event_initialize(to_event_t *to)
    250250{
    251         struct timeval tv = { 0, 0 };
     251        struct timeval tv = { 0 };
    252252
    253253        to->inlist = false;
     
    10171017               
    10181018                suseconds_t timeout;
    1019                 unsigned int flags = SYNCH_FLAGS_NONE;
    10201019                if (!list_empty(&timeout_list)) {
    10211020                        awaiter_t *waiter = list_get_instance(
     
    10281027                                futex_up(&async_futex);
    10291028                                handle_expired_timeouts();
    1030                                 /*
    1031                                  * Notice that even if the event(s) already
    1032                                  * expired (and thus the other fibril was
    1033                                  * supposed to be running already),
    1034                                  * we check for incoming IPC.
    1035                                  *
    1036                                  * Otherwise, a fibril that continuously
    1037                                  * creates (almost) expired events could
    1038                                  * prevent IPC retrieval from the kernel.
    1039                                  */
    1040                                 timeout = 0;
    1041                                 flags = SYNCH_FLAGS_NON_BLOCKING;
    1042 
    1043                         } else {
     1029                                continue;
     1030                        } else
    10441031                                timeout = tv_sub(&waiter->to_event.expires, &tv);
    1045                                 futex_up(&async_futex);
    1046                         }
    1047                 } else {
    1048                         futex_up(&async_futex);
     1032                } else
    10491033                        timeout = SYNCH_NO_TIMEOUT;
    1050                 }
     1034               
     1035                futex_up(&async_futex);
    10511036               
    10521037                atomic_inc(&threads_in_ipc_wait);
    10531038               
    10541039                ipc_call_t call;
    1055                 ipc_callid_t callid = ipc_wait_cycle(&call, timeout, flags);
     1040                ipc_callid_t callid = ipc_wait_cycle(&call, timeout,
     1041                    SYNCH_FLAGS_NONE);
    10561042               
    10571043                atomic_dec(&threads_in_ipc_wait);
     
    13121298       
    13131299        amsg_t *msg = (amsg_t *) amsgid;
    1314 
     1300       
     1301        /* TODO: Let it go through the event read at least once */
     1302        if (timeout < 0)
     1303                return ETIMEOUT;
     1304       
    13151305        futex_down(&async_futex);
    13161306
     
    13231313        }
    13241314       
    1325         /*
    1326          * Negative timeout is converted to zero timeout to avoid
    1327          * using tv_add with negative augmenter.
    1328          */
    1329         if (timeout < 0)
    1330                 timeout = 0;
    1331 
    13321315        gettimeofday(&msg->wdata.to_event.expires, NULL);
    13331316        tv_add(&msg->wdata.to_event.expires, timeout);
    13341317       
    1335         /*
    1336          * Current fibril is inserted as waiting regardless of the
    1337          * "size" of the timeout.
    1338          *
    1339          * Checking for msg->done and immediately bailing out when
    1340          * timeout == 0 would mean that the manager fibril would never
    1341          * run (consider single threaded program).
    1342          * Thus the IPC answer would be never retrieved from the kernel.
    1343          *
    1344          * Notice that the actual delay would be very small because we
    1345          * - switch to manager fibril
    1346          * - the manager sees expired timeout
    1347          * - and thus adds us back to ready queue
    1348          * - manager switches back to some ready fibril
    1349          *   (prior it, it checks for incoming IPC).
    1350          *
    1351          */
    13521318        msg->wdata.fid = fibril_get_id();
    13531319        msg->wdata.active = false;
Note: See TracChangeset for help on using the changeset viewer.