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