summaryrefslogtreecommitdiffstats
path: root/src/include/k5-thread.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2005-01-14 05:03:48 +0000
committerKen Raeburn <raeburn@mit.edu>2005-01-14 05:03:48 +0000
commitc8fcc72982cb9c4718fd520d70e69d3a30c0af15 (patch)
tree6c67edb6be84f7de81bd6db8ce2bc5ecf66cc87d /src/include/k5-thread.h
parente9e0c8766bc7343b03ffd05abe08362cb6d755a9 (diff)
downloadkrb5-c8fcc72982cb9c4718fd520d70e69d3a30c0af15.tar.gz
krb5-c8fcc72982cb9c4718fd520d70e69d3a30c0af15.tar.xz
krb5-c8fcc72982cb9c4718fd520d70e69d3a30c0af15.zip
* k5-thread.h (k5_pthread_assert_locked): Only call pthread_equal if
thread support is loaded. (k5_pthread_mutex_unlock): Use k5_pthread_assert_locked instead of duplicating it. ticket: 2878 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17036 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include/k5-thread.h')
-rw-r--r--src/include/k5-thread.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h
index 32b793d37..88a14caab 100644
--- a/src/include/k5-thread.h
+++ b/src/include/k5-thread.h
@@ -489,11 +489,13 @@ k5_pthread_mutex_lock(k5_os_mutex *m)
return 0;
}
# endif
-# define k5_pthread_assert_locked(M) \
- (assert(pthread_equal((M)->owner, pthread_self())))
-# define k5_pthread_mutex_unlock(M) \
- (assert(pthread_equal((M)->owner, pthread_self())), \
- (M)->owner = (pthread_t) 0, \
+# define k5_pthread_assert_locked(M) \
+ (K5_PTHREADS_LOADED \
+ ? assert(pthread_equal((M)->owner, pthread_self())) \
+ : (void)0)
+# define k5_pthread_mutex_unlock(M) \
+ (k5_pthread_assert_locked(M), \
+ (M)->owner = (pthread_t) 0, \
pthread_mutex_unlock(&(M)->p))
#else
# define k5_pthread_mutex_lock(M) pthread_mutex_lock(&(M)->p)