1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #include "test.h"
- static void *
- func(void * arg)
- {
- pthread_exit(arg);
-
- assert(0);
- return NULL;
- }
- int pthread_test_exit3()
- {
- pthread_t id[4];
- int i;
-
- for (i = 0; i < 4; i++)
- {
- assert(pthread_create(&id[i], NULL, func, (void *) i) == 0);
- }
- pte_osThreadSleep(1000);
- for (i = 0; i < 4; i++)
- {
- void * retValue;
- assert(pthread_join(id[i],&retValue) == 0);
- assert((int)retValue == i);
- }
-
- return 0;
- }
|