Fix broken smb_thread_once function (again)
[ira/wip.git] / lib / util / smb_threads.c
index 6f84a2e7476d78dc82bff6bb5df58fbb6c90ab0c..e2d01f775a4e0e7d09183fa704a2ff6d9001207e 100644 (file)
@@ -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 */