Lines Matching refs:lk

1929 static FORCEINLINE void recursive_release_lock(MLOCK_T *lk) {  in recursive_release_lock()  argument
1930 assert(lk->sl != 0); in recursive_release_lock()
1931 if (--lk->c == 0) { in recursive_release_lock()
1932 CLEAR_LOCK(&lk->sl); in recursive_release_lock()
1936 static FORCEINLINE int recursive_acquire_lock(MLOCK_T *lk) { in recursive_acquire_lock() argument
1940 if (*((volatile int *)(&lk->sl)) == 0) { in recursive_acquire_lock()
1941 if (!CAS_LOCK(&lk->sl)) { in recursive_acquire_lock()
1942 lk->threadid = mythreadid; in recursive_acquire_lock()
1943 lk->c = 1; in recursive_acquire_lock()
1947 else if (EQ_OWNER(lk->threadid, mythreadid)) { in recursive_acquire_lock()
1948 ++lk->c; in recursive_acquire_lock()
1957 static FORCEINLINE int recursive_try_lock(MLOCK_T *lk) { in recursive_try_lock() argument
1959 if (*((volatile int *)(&lk->sl)) == 0) { in recursive_try_lock()
1960 if (!CAS_LOCK(&lk->sl)) { in recursive_try_lock()
1961 lk->threadid = mythreadid; in recursive_try_lock()
1962 lk->c = 1; in recursive_try_lock()
1966 else if (EQ_OWNER(lk->threadid, mythreadid)) { in recursive_try_lock()
1967 ++lk->c; in recursive_try_lock()
1973 #define RELEASE_LOCK(lk) recursive_release_lock(lk) argument
1974 #define TRY_LOCK(lk) recursive_try_lock(lk) argument
1975 #define ACQUIRE_LOCK(lk) recursive_acquire_lock(lk) argument
1976 #define INITIAL_LOCK(lk) ((lk)->threadid = (THREAD_ID_T)0, (lk)->sl = 0, (lk)->c = 0) argument
1977 #define DESTROY_LOCK(lk) (0) argument
1982 #define ACQUIRE_LOCK(lk) (EnterCriticalSection(lk), 0) argument
1983 #define RELEASE_LOCK(lk) LeaveCriticalSection(lk) argument
1984 #define TRY_LOCK(lk) TryEnterCriticalSection(lk) argument
1985 #define INITIAL_LOCK(lk) (!InitializeCriticalSectionAndSpinCount((lk), 0x80000000|4000)) argument
1986 #define DESTROY_LOCK(lk) (DeleteCriticalSection(lk), 0) argument
2011 #define ACQUIRE_LOCK(lk) pthread_mutex_lock(lk) argument
2012 #define RELEASE_LOCK(lk) pthread_mutex_unlock(lk) argument
2013 #define TRY_LOCK(lk) (!pthread_mutex_trylock(lk)) argument
2014 #define INITIAL_LOCK(lk) pthread_init_lock(lk) argument
2015 #define DESTROY_LOCK(lk) pthread_mutex_destroy(lk) argument
2028 static int pthread_init_lock (MLOCK_T *lk) { in pthread_init_lock() argument
2034 if (pthread_mutex_init(lk, &attr)) return 1; in pthread_init_lock()