Changeset 109 in libcf for trunk/test/log.c
- Timestamp:
- 06/04/13 14:25:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/log.c
r108 r109 9 9 #include <stdio.h> 10 10 11 CF_Mutex globalMutex;11 CF_Mutex_Ctx globalMutex; 12 12 13 13 #define LOG_MT 1 … … 41 41 int main (void) 42 42 { 43 int i, j;44 char idname[16] = {0x00,};45 CF_Thread tid[10];43 int i, j; 44 char idname[16] = {0x00,}; 45 CF_Thread_Ctx tid[10]; 46 46 47 47 /* initialize */ … … 79 79 CF_DEBUG_PRINT (stderr, "set multi-threading mode error\n"); 80 80 81 if (CF_Mutex_Create (&globalMutex) < 0) {81 if (CF_Mutex_CreateCtx (&globalMutex) < 0) { 82 82 // error 83 83 } … … 85 85 for (i = 0 ; i < 10 ; i++) 86 86 { 87 if (CF_Thread_Create (&tid[i], test_log_mt, &i) < 0)87 if (CF_Thread_CreateCtx (&tid[i], test_log_mt, &i) < 0) 88 88 { 89 89 CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", i); … … 96 96 if (CF_Thread_Join (&tid[i]) < 0) 97 97 CF_DEBUG_PRINT (stderr, "failed to join %dth thread\n", i); 98 if (CF_Thread_ Release(&tid[i]) < 0)98 if (CF_Thread_DestroyCtx (&tid[i]) < 0) 99 99 CF_DEBUG_PRINT (stderr, "failed to release %dth thread\n", i); 100 100 } 101 101 102 if (CF_Mutex_Destory (&globalMutex) < 0) {102 if (CF_Mutex_DestoryCtx (&globalMutex) < 0) { 103 103 // error 104 104 }
Note:
See TracChangeset
for help on using the changeset viewer.