Changes in uspace/app/tester/ipc/starve.c [1ab8539:07b7c48] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/ipc/starve.c
r1ab8539 r07b7c48 40 40 const char *err = NULL; 41 41 console_ctrl_t *console = console_init(stdin, stdout); 42 if (console == NULL) 42 if (console == NULL) { 43 43 return "Failed to init connection with console."; 44 } 44 45 45 46 struct timeval start; 46 gettimeofday(&start, NULL); 47 if (gettimeofday(&start, NULL) != 0) { 48 err = "Failed getting the time"; 49 goto leave; 50 } 47 51 48 52 TPRINTF("Intensive computation shall be imagined (for %ds)...\n", DURATION_SECS); … … 50 54 while (true) { 51 55 struct timeval now; 52 gettimeofday(&now, NULL); 56 if (gettimeofday(&now, NULL) != 0) { 57 err = "Failed getting the time"; 58 goto leave; 59 } 53 60 54 61 if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L) … … 63 70 } 64 71 } 65 72 66 73 // FIXME - unless a key was pressed, the answer leaked as no one 67 74 // will wait for it. 68 75 // We cannot use async_forget() directly, though. Something like 69 76 // console_forget_pending_kbd_event() shall come here. 70 77 71 78 TPRINTF("Terminating...\n"); 72 79 80 leave: 73 81 console_done(console); 74 82 75 83 return err; 76 84 }
Note:
See TracChangeset
for help on using the changeset viewer.