Changeset 151 in libcf for trunk/src/cf_mutex.c
- Timestamp:
- 10/31/13 10:17:24 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_mutex.c
r149 r151 21 21 #endif // #if defined(_WIN32) || defined(_WIN64) 22 22 23 #define ASSERT_ MUTEX_CTX(__ctx) \24 if (__ctx == NULL) 23 #define ASSERT_CTX(__ctx) \ 24 if (__ctx == NULL) \ 25 25 return CF_ERROR_MUTEX_INVALID_CTX 26 26 … … 38 38 */ 39 39 int 40 CF_Mutex_Create Ctx (CF_Mutex_Ctx * ctx)40 CF_Mutex_Create (cf_ctx * ctx) 41 41 { 42 42 int result = 0; … … 44 44 CF_MUTEX_CONTEXT * context = NULL; 45 45 46 context = (CF_MUTEX_CONTEXT *) calloc (sizeof (CF_MUTEX_CONTEXT), 1); 46 ASSERT_CTX (ctx); 47 48 context = NEWCTX (CF_MUTEX_CONTEXT); 47 49 if (context == NULL) 48 50 return CF_ERROR_MUTEX_CREATE_CTX; … … 70 72 CATCH_IF (result < 0) 71 73 { 72 CF_Mutex_Destory Ctx ((CF_Mutex_Ctx) context);74 CF_Mutex_Destory ((cf_ctx) context); 73 75 } 74 76 … … 84 86 */ 85 87 int 86 CF_Mutex_Destory Ctx (CF_Mutex_Ctx ctx)88 CF_Mutex_Destory (cf_ctx ctx) 87 89 { 88 CF_MUTEX_CONTEXT * context = ctx;90 CF_MUTEX_CONTEXT * context = (CF_MUTEX_CONTEXT *) ctx; 89 91 90 ASSERT_ MUTEX_CTX (ctx);92 ASSERT_CTX (ctx); 91 93 92 94 #if defined(_WIN32) || defined(_WIN64) … … 112 114 */ 113 115 int 114 CF_Mutex_Lock ( CF_Mutex_Ctx ctx)116 CF_Mutex_Lock (cf_ctx ctx) 115 117 { 116 CF_MUTEX_CONTEXT * context = ctx;118 CF_MUTEX_CONTEXT * context = (CF_MUTEX_CONTEXT *) ctx; 117 119 118 ASSERT_ MUTEX_CTX (ctx);120 ASSERT_CTX (ctx); 119 121 120 122 #if defined(_WIN32) || defined(_WIN64) … … 135 137 */ 136 138 int 137 CF_Mutex_Unlock ( CF_Mutex_Ctx ctx)139 CF_Mutex_Unlock (cf_ctx ctx) 138 140 { 139 CF_MUTEX_CONTEXT * context = ctx;141 CF_MUTEX_CONTEXT * context = (CF_MUTEX_CONTEXT *) ctx; 140 142 141 ASSERT_ MUTEX_CTX (ctx);143 ASSERT_CTX (ctx); 142 144 143 145 #if defined(_WIN32) || defined(_WIN64)
Note:
See TracChangeset
for help on using the changeset viewer.