Panic upon mutex lock or unlock failure
authorDerrell Lipman <derrell@dworkin.(none)>
Mon, 11 May 2009 02:40:20 +0000 (22:40 -0400)
committerDerrell Lipman <derrell@dworkin.(none)>
Mon, 11 May 2009 02:45:12 +0000 (22:45 -0400)
- It's a serious error if we can't lock or unlock a mutex in
  smb_thread_once(). Panic instead of just displaying a DEBUG message.

Derrell

lib/util/smb_threads.c

index 8cddbf01762df98b167ba1cf73d22b4142fcf0ac..132ad48784de230cb36e3327a76e725d5088be58 100644 (file)
@@ -111,7 +111,7 @@ void smb_thread_once(smb_thread_once_t *ponce, void (*init_fn)(void))
 
         /* Lock our "once" mutex in order to test and initialize ponce */
        if ((ret = SMB_THREAD_LOCK(once_mutex, SMB_THREAD_LOCK)) != 0) {
-               DEBUG(0, ("error locking 'once': %d\n", ret));
+                smb_panic("error locking 'once'");
        }
 
         /* Store whether we're going to need to issue the function call */
@@ -134,7 +134,7 @@ void smb_thread_once(smb_thread_once_t *ponce, void (*init_fn)(void))
 
         /* Unlock the mutex */
        if ((ret = SMB_THREAD_LOCK(once_mutex, SMB_THREAD_UNLOCK)) != 0) {
-               DEBUG(0, ("error unlocking 'once': %d\n", ret));
+                smb_panic("error unlocking 'once'");
        }
 
         /* Finally, if we need to call the user-provided function, ... */