Changes in / [f76696f:b8d6783] in mainline
- Location:
- uspace
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/Makefile
rf76696f rb8d6783 50 50 vfs/vfs1.c \ 51 51 ipc/ping_pong.c \ 52 ipc/starve.c \53 52 loop/loop1.c \ 54 53 mm/common.c \ -
uspace/app/tester/tester.c
rf76696f rb8d6783 60 60 #include "vfs/vfs1.def" 61 61 #include "ipc/ping_pong.def" 62 #include "ipc/starve.def"63 62 #include "loop/loop1.def" 64 63 #include "mm/malloc1.def" -
uspace/app/tester/tester.h
rf76696f rb8d6783 93 93 extern const char *test_vfs1(void); 94 94 extern const char *test_ping_pong(void); 95 extern const char *test_starve_ipc(void);96 95 extern const char *test_loop1(void); 97 96 extern const char *test_malloc1(void); -
uspace/lib/c/generic/async.c
rf76696f rb8d6783 249 249 static void to_event_initialize(to_event_t *to) 250 250 { 251 struct timeval tv = { 0 , 0};251 struct timeval tv = { 0 }; 252 252 253 253 to->inlist = false; … … 1017 1017 1018 1018 suseconds_t timeout; 1019 unsigned int flags = SYNCH_FLAGS_NONE;1020 1019 if (!list_empty(&timeout_list)) { 1021 1020 awaiter_t *waiter = list_get_instance( … … 1028 1027 futex_up(&async_futex); 1029 1028 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 1044 1031 timeout = tv_sub(&waiter->to_event.expires, &tv); 1045 futex_up(&async_futex); 1046 } 1047 } else { 1048 futex_up(&async_futex); 1032 } else 1049 1033 timeout = SYNCH_NO_TIMEOUT; 1050 } 1034 1035 futex_up(&async_futex); 1051 1036 1052 1037 atomic_inc(&threads_in_ipc_wait); 1053 1038 1054 1039 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); 1056 1042 1057 1043 atomic_dec(&threads_in_ipc_wait); … … 1312 1298 1313 1299 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 1315 1305 futex_down(&async_futex); 1316 1306 … … 1323 1313 } 1324 1314 1325 /*1326 * Negative timeout is converted to zero timeout to avoid1327 * using tv_add with negative augmenter.1328 */1329 if (timeout < 0)1330 timeout = 0;1331 1332 1315 gettimeofday(&msg->wdata.to_event.expires, NULL); 1333 1316 tv_add(&msg->wdata.to_event.expires, timeout); 1334 1317 1335 /*1336 * Current fibril is inserted as waiting regardless of the1337 * "size" of the timeout.1338 *1339 * Checking for msg->done and immediately bailing out when1340 * timeout == 0 would mean that the manager fibril would never1341 * 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 we1345 * - switch to manager fibril1346 * - the manager sees expired timeout1347 * - and thus adds us back to ready queue1348 * - manager switches back to some ready fibril1349 * (prior it, it checks for incoming IPC).1350 *1351 */1352 1318 msg->wdata.fid = fibril_get_id(); 1353 1319 msg->wdata.active = false;
Note:
See TracChangeset
for help on using the changeset viewer.