From: Derrell Lipman Date: Mon, 11 May 2009 02:40:20 +0000 (-0400) Subject: Panic upon mutex lock or unlock failure X-Git-Tag: tdb-1.1.5~643 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=404327ad41c5f24f9ace5cad31509149d87197fd Panic upon mutex lock or unlock failure - 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 --- diff --git a/lib/util/smb_threads.c b/lib/util/smb_threads.c index 8cddbf01762..132ad48784d 100644 --- a/lib/util/smb_threads.c +++ b/lib/util/smb_threads.c @@ -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, ... */