Changeset 109 in libcf for trunk/src/cf_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/src/cf_thread.c

    r85 r109  
    6565 */
    6666int
    67 CF_Thread_Create (CF_Thread             * threadID,
    68                   CF_Thread_Function    callback,
    69                   void                  * arg)
     67CF_Thread_CreateCtx (CF_Thread_Ctx      * threadID,
     68                    CF_Thread_Function callback,
     69                     void               * arg)
    7070{
    7171    int result = 0;
     
    106106    *threadID = (THREAD_TYPE *) calloc (sizeof (THREAD_TYPE), 1);
    107107    if (*threadID == NULL)
    108         return CF_ERROR_THREAD_ALLOC;
     108        return CF_ERROR_THREAD_CREATE_CTX;
    109109
    110110    result = pthread_create ((THREAD_TYPE *) *threadID, attr, f, arg);
    111111    if (result)
    112112    {
    113         CF_Thread_Release (threadID);
     113        CF_Thread_DestroyCtx (threadID);
    114114        return CF_ERROR_THREAD_CREATE;
    115115    }
     
    129129 */
    130130int
    131 CF_Thread_Release (CF_Thread * threadID)
     131CF_Thread_DestroyCtx (CF_Thread_Ctx * threadID)
    132132{
    133133    ASSERT_THREAD (*threadID);
     
    144144 */
    145145int
    146 CF_Thread_Join (CF_Thread * threadID)
     146CF_Thread_Join (CF_Thread_Ctx * threadID)
    147147{
    148148    ASSERT_THREAD (*threadID);
     
    168168 */
    169169int
    170 CF_Mutex_Create (CF_Mutex * mutex)
     170CF_Mutex_CreateCtx (CF_Mutex_Ctx * mutex)
    171171{
    172172    int result = 0;
     
    197197 */
    198198int
    199 CF_Mutex_Destory (CF_Mutex * mutex)
     199CF_Mutex_DestoryCtx (CF_Mutex_Ctx * mutex)
    200200{
    201201    ASSERT_MUTEX (*mutex);
     
    216216 */
    217217int
    218 CF_Mutex_Lock (CF_Mutex * mutex)
     218CF_Mutex_Lock (CF_Mutex_Ctx * mutex)
    219219{
    220220    ASSERT_MUTEX (*mutex);
     
    237237 */
    238238int
    239 CF_Mutex_Unlock (CF_Mutex * mutex)
     239CF_Mutex_Unlock (CF_Mutex_Ctx * mutex)
    240240{
    241241    ASSERT_MUTEX (*mutex);
Note: See TracChangeset for help on using the changeset viewer.