Rev 1113 | Rev 1128 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1113 | Rev 1125 | ||
---|---|---|---|
Line 272... | Line 272... | ||
272 | pstid_t ptid; |
272 | pstid_t ptid; |
273 | int tid; |
273 | int tid; |
274 | 274 | ||
275 | version_print(); |
275 | version_print(); |
276 | 276 | ||
277 | /* test_printf(); */ |
277 | // test_printf(); |
278 | // test_ping(); |
278 | // test_ping(); |
279 | // test_async_ipc(); |
279 | // test_async_ipc(); |
280 | // test_advanced_ipc(); |
280 | // test_advanced_ipc(); |
281 | // test_connection_ipc(); |
281 | // test_connection_ipc(); |
282 | // test_hangup(); |
282 | // test_hangup(); |
Line 286... | Line 286... | ||
286 | if (futex_down(&ftx) < 0) |
286 | if (futex_down(&ftx) < 0) |
287 | printf("Futex failed.\n"); |
287 | printf("Futex failed.\n"); |
288 | if (futex_up(&ftx) < 0) |
288 | if (futex_up(&ftx) < 0) |
289 | printf("Futex failed.\n"); |
289 | printf("Futex failed.\n"); |
290 | 290 | ||
291 | if ((tid = thread_create(utest, NULL, "utest") != -1)) { |
- | |
292 | printf("Created thread tid=%d\n", tid); |
- | |
293 | } |
- | |
294 | - | ||
295 | if (futex_down(&ftx) < 0) |
291 | if (futex_down(&ftx) < 0) |
296 | printf("Futex failed.\n"); |
292 | printf("Futex failed.\n"); |
297 | 293 | ||
298 | if ((tid = thread_create(utest, NULL, "utest") != -1)) { |
294 | if ((tid = thread_create(utest, NULL, "utest")) != -1) { |
- | 295 | printf("Created thread tid=%d\n", tid); |
|
- | 296 | } |
|
- | 297 | ||
- | 298 | if ((tid = thread_create(utest, NULL, "utest")) != -1) { |
|
299 | printf("Created thread tid=%d\n", tid); |
299 | printf("Created thread tid=%d\n", tid); |
300 | } |
300 | } |
301 | 301 | ||
302 | int i; |
302 | int i; |
303 | 303 | ||
304 | for (i = 0; i < 10000000; i++) |
304 | for (i = 0; i < 50000000; i++) |
305 | ; |
305 | ; |
306 | 306 | ||
307 | if (futex_up(&ftx) < 0) |
307 | if (futex_up(&ftx) < 0) |
308 | printf("Futex failed.\n"); |
308 | printf("Futex failed.\n"); |
309 | 309 | ||
310 | ptid = psthread_create(ptest, NULL); |
310 | ptid = psthread_create(ptest, NULL); |
311 | printf("Main thread-1\n"); |
311 | printf("main thread-1\n"); |
312 | ps_preempt(); |
312 | ps_preempt(); |
313 | printf("Main thread-2\n"); |
313 | printf("main thread-2\n"); |
314 | ps_preempt(); |
314 | ps_preempt(); |
315 | printf("main thread-3\n"); |
315 | printf("main thread-3\n"); |
316 | 316 | ||
317 | ps_join(ptid); |
317 | ps_join(ptid); |
318 | printf("Main exiting\n"); |
318 | printf("Main exiting\n"); |