4 #ifndef __WIFI_HAL_SYNC_H__
5 #define __WIFI_HAL_SYNC_H__
10 pthread_mutex_t mMutex
;
13 pthread_mutex_init(&mMutex
, NULL
);
16 pthread_mutex_destroy(&mMutex
);
19 return pthread_mutex_trylock(&mMutex
);
22 return pthread_mutex_lock(&mMutex
);
25 pthread_mutex_unlock(&mMutex
);
32 pthread_cond_t mCondition
;
33 pthread_mutex_t mMutex
;
37 pthread_mutex_init(&mMutex
, NULL
);
38 pthread_cond_init(&mCondition
, NULL
);
41 pthread_cond_destroy(&mCondition
);
42 pthread_mutex_destroy(&mMutex
);
46 return pthread_cond_wait(&mCondition
, &mMutex
);
50 pthread_cond_signal(&mCondition
);