From 7c39e450fc4216e1138e4f30d2c1e2b6ba3854a8 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Tue, 12 May 2009 21:32:33 -0400 Subject: Fix broken smb_thread_once function (again) - It would help if smb_thread_once did, eventually, set the variable that prevents the init function from being run again. Sigh. It must be getting late. Derrell --- lib/util/smb_threads.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/util') diff --git a/lib/util/smb_threads.c b/lib/util/smb_threads.c index 6f84a2e747..e2d01f775a 100644 --- a/lib/util/smb_threads.c +++ b/lib/util/smb_threads.c @@ -121,6 +121,9 @@ int smb_thread_once(smb_thread_once_t *ponce, void (*init_fn)(void)) if (! *ponce) { /* Nope, we need to run the initialization function */ (*init_fn)(); + + /* Now we can indicate that the function has been run */ + *ponce = true; } /* Unlock the mutex */ -- cgit