Lines Matching refs:lk
1922 static FORCEINLINE void recursive_release_lock(MLOCK_T *lk) { in recursive_release_lock() argument
1923 assert(lk->sl != 0); in recursive_release_lock()
1924 if (--lk->c == 0) { in recursive_release_lock()
1925 CLEAR_LOCK(&lk->sl); in recursive_release_lock()
1929 static FORCEINLINE int recursive_acquire_lock(MLOCK_T *lk) { in recursive_acquire_lock() argument
1933 if (*((volatile int *)(&lk->sl)) == 0) { in recursive_acquire_lock()
1934 if (!CAS_LOCK(&lk->sl)) { in recursive_acquire_lock()
1935 lk->threadid = mythreadid; in recursive_acquire_lock()
1936 lk->c = 1; in recursive_acquire_lock()
1940 else if (EQ_OWNER(lk->threadid, mythreadid)) { in recursive_acquire_lock()
1941 ++lk->c; in recursive_acquire_lock()
1950 static FORCEINLINE int recursive_try_lock(MLOCK_T *lk) { in recursive_try_lock() argument
1952 if (*((volatile int *)(&lk->sl)) == 0) { in recursive_try_lock()
1953 if (!CAS_LOCK(&lk->sl)) { in recursive_try_lock()
1954 lk->threadid = mythreadid; in recursive_try_lock()
1955 lk->c = 1; in recursive_try_lock()
1959 else if (EQ_OWNER(lk->threadid, mythreadid)) { in recursive_try_lock()
1960 ++lk->c; in recursive_try_lock()
1966 #define RELEASE_LOCK(lk) recursive_release_lock(lk) argument
1967 #define TRY_LOCK(lk) recursive_try_lock(lk) argument
1968 #define ACQUIRE_LOCK(lk) recursive_acquire_lock(lk) argument
1969 #define INITIAL_LOCK(lk) ((lk)->threadid = (THREAD_ID_T)0, (lk)->sl = 0, (lk)->c = 0) argument
1970 #define DESTROY_LOCK(lk) (0) argument
1975 #define ACQUIRE_LOCK(lk) (EnterCriticalSection(lk), 0) argument
1976 #define RELEASE_LOCK(lk) LeaveCriticalSection(lk) argument
1977 #define TRY_LOCK(lk) TryEnterCriticalSection(lk) argument
1978 #define INITIAL_LOCK(lk) (!InitializeCriticalSectionAndSpinCount((lk), 0x80000000|4000)) argument
1979 #define DESTROY_LOCK(lk) (DeleteCriticalSection(lk), 0) argument
2004 #define ACQUIRE_LOCK(lk) pthread_mutex_lock(lk) argument
2005 #define RELEASE_LOCK(lk) pthread_mutex_unlock(lk) argument
2006 #define TRY_LOCK(lk) (!pthread_mutex_trylock(lk)) argument
2007 #define INITIAL_LOCK(lk) pthread_init_lock(lk) argument
2008 #define DESTROY_LOCK(lk) pthread_mutex_destroy(lk) argument
2021 static int pthread_init_lock (MLOCK_T *lk) { in pthread_init_lock() argument
2027 if (pthread_mutex_init(lk, &attr)) return 1; in pthread_init_lock()