summaryrefslogtreecommitdiff
path: root/lib/util/smb_threads.c
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@dworkin.(none)>2009-05-13 14:31:40 -0400
committerDerrell Lipman <derrell@dworkin.(none)>2009-05-13 14:37:28 -0400
commit088906b0641e48c704c5cd529f620023616f561f (patch)
treeb80f75c5ac50ace8e16032066b2bd0d61f84c107 /lib/util/smb_threads.c
parentb9f3a78169be962c4f1fce625ca3a291d9f93c7c (diff)
downloadsamba-088906b0641e48c704c5cd529f620023616f561f.tar.gz
samba-088906b0641e48c704c5cd529f620023616f561f.tar.bz2
samba-088906b0641e48c704c5cd529f620023616f561f.zip
Make the thread functions a bit easier to use
- Create separate macros for lock and unlock so that it's easier to identify which request is being made. - Initialize *ponce in the SMB_THREAD_ONCE macro in the non-thread-safe case, rather than requiring each init function to determine if it's in the non-thread-safe case and manually initialize. Derrell
Diffstat (limited to 'lib/util/smb_threads.c')
-rw-r--r--lib/util/smb_threads.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/util/smb_threads.c b/lib/util/smb_threads.c
index ffe2eb0114..58ea2daa67 100644
--- a/lib/util/smb_threads.c
+++ b/lib/util/smb_threads.c
@@ -43,7 +43,7 @@ void **global_lock_array;
Mutex used for our internal "once" function
*********************************************************/
-void *once_mutex = NULL;
+static void *once_mutex = NULL;
/*********************************************************
@@ -112,7 +112,7 @@ int smb_thread_once(smb_thread_once_t *ponce,
int ret;
/* Lock our "once" mutex in order to test and initialize ponce */
- if (SMB_THREAD_LOCK(once_mutex, SMB_THREAD_LOCK) != 0) {
+ if (SMB_THREAD_LOCK(once_mutex) != 0) {
smb_panic("error locking 'once'");
}
@@ -132,7 +132,7 @@ int smb_thread_once(smb_thread_once_t *ponce,
}
/* Unlock the mutex */
- if (SMB_THREAD_LOCK(once_mutex, SMB_THREAD_UNLOCK) != 0) {
+ if (SMB_THREAD_UNLOCK(once_mutex) != 0) {
smb_panic("error unlocking 'once'");
}