Changeset 109 in libcf for trunk/test/thread.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/thread.c

    r66 r109  
    77#include <stdio.h>
    88
    9 CF_Mutex globalMutex;
     9CF_Mutex_Ctx globalMutex;
    1010
    1111int worker (void * arg) {
     
    2424
    2525int main (void) {
    26     CF_Thread tid[10];
     26    CF_Thread_Ctx tid[10];
    2727    int i = 0;
    2828
    29     if (CF_Mutex_Create (&globalMutex) < 0) {
     29    if (CF_Mutex_CreateCtx (&globalMutex) < 0) {
    3030        // error
    3131    }
    3232
    3333    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) {
    3535            // error
    3636        }
     
    4444
    4545    for (i = 0 ; i < 10 ; i++) {
    46         if (CF_Thread_Release (&tid[i]) < 0) {
     46        if (CF_Thread_DestroyCtx (&tid[i]) < 0) {
    4747            // error
    4848        }
    4949    }
    5050
    51     if (CF_Mutex_Destory (&globalMutex) < 0) {
     51    if (CF_Mutex_DestoryCtx (&globalMutex) < 0) {
    5252        // error
    5353    }
Note: See TracChangeset for help on using the changeset viewer.