Changeset 109 in libcf for trunk/test/thread.c
- Timestamp:
- 06/04/13 14:25:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/thread.c
r66 r109 7 7 #include <stdio.h> 8 8 9 CF_Mutex globalMutex;9 CF_Mutex_Ctx globalMutex; 10 10 11 11 int worker (void * arg) { … … 24 24 25 25 int main (void) { 26 CF_Thread tid[10];26 CF_Thread_Ctx tid[10]; 27 27 int i = 0; 28 28 29 if (CF_Mutex_Create (&globalMutex) < 0) {29 if (CF_Mutex_CreateCtx (&globalMutex) < 0) { 30 30 // error 31 31 } 32 32 33 33 for (i = 0 ; i < 10 ; i++) { 34 if (CF_Thread_Create (&tid[i], worker, NULL) < 0) {34 if (CF_Thread_CreateCtx (&tid[i], worker, NULL) < 0) { 35 35 // error 36 36 } … … 44 44 45 45 for (i = 0 ; i < 10 ; i++) { 46 if (CF_Thread_ Release(&tid[i]) < 0) {46 if (CF_Thread_DestroyCtx (&tid[i]) < 0) { 47 47 // error 48 48 } 49 49 } 50 50 51 if (CF_Mutex_Destory (&globalMutex) < 0) {51 if (CF_Mutex_DestoryCtx (&globalMutex) < 0) { 52 52 // error 53 53 }
Note:
See TracChangeset
for help on using the changeset viewer.