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


Ignore:
Timestamp:
06/04/13 14:25:10 (11 years ago)
Author:
cheese
Message:

#1 add typical data structure algorithms (linked-list / queue / stak) and rename symbol for context of each modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/log.c

    r108 r109  
    99#include <stdio.h>
    1010
    11 CF_Mutex globalMutex;
     11CF_Mutex_Ctx globalMutex;
    1212
    1313#define LOG_MT      1
     
    4141int main (void)
    4242{
    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];
    4646
    4747    /* initialize */
     
    7979        CF_DEBUG_PRINT (stderr, "set multi-threading mode error\n");
    8080
    81     if (CF_Mutex_Create (&globalMutex) < 0) {
     81    if (CF_Mutex_CreateCtx (&globalMutex) < 0) {
    8282        // error
    8383    }
     
    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);
     
    9696        if (CF_Thread_Join (&tid[i]) < 0)
    9797            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)
    9999            CF_DEBUG_PRINT (stderr, "failed to release %dth thread\n", i);
    100100    }
    101101
    102     if (CF_Mutex_Destory (&globalMutex) < 0) {
     102    if (CF_Mutex_DestoryCtx (&globalMutex) < 0) {
    103103        // error
    104104    }
Note: See TracChangeset for help on using the changeset viewer.