Changeset 122 in libcf for trunk/test/log.c


Ignore:
Timestamp:
06/12/13 11:05:07 (11 years ago)
Author:
cheese
Message:

#1 modify id to context in thread

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/log.c

    r121 r122  
    8585    for (i = 0 ; i < 10 ; i++)
    8686    {
    87         if (CF_Thread_Create (&tid[i], test_log_mt, &i) < 0)
     87        if (CF_Thread_CreateCtx (&tid[i], test_log_mt, &i) < 0)
    8888        {
    8989            CF_DEBUG_PRINT (stderr, "failed to create %dth thread\n", i);
     
    9494    for (i = 0 ; i < 10 ; i++)
    9595    {
    96         if (CF_Thread_Join (&tid[i]) < 0)
     96        if (CF_Thread_Start (tid[i]) < 0)
     97        {
     98            CF_DEBUG_PRINT (stderr, "failed to start %dth thread\n", i);
     99            return -3;
     100        }
     101    }
     102
     103    for (i = 0 ; i < 10 ; i++)
     104    {
     105        if (CF_Thread_Join (tid[i]) < 0)
    97106            CF_DEBUG_PRINT (stderr, "failed to join %dth thread\n", i);
    98         if (CF_Thread_DestroyCtx (&tid[i]) < 0)
     107        if (CF_Thread_DestroyCtx (tid[i]) < 0)
    99108            CF_DEBUG_PRINT (stderr, "failed to release %dth thread\n", i);
    100109    }
    101110
    102     if (CF_Mutex_DestoryCtx (&globalMutex) < 0) {
     111    if (CF_Mutex_DestoryCtx (globalMutex) < 0) {
    103112        // error
    104113    }
Note: See TracChangeset for help on using the changeset viewer.