Fix broken smb_thread_once function
authorDerrell Lipman <derrell@dworkin.(none)>
Wed, 13 May 2009 01:22:23 +0000 (21:22 -0400)
committerDerrell Lipman <derrell@dworkin.(none)>
Wed, 13 May 2009 01:24:34 +0000 (21:24 -0400)
commit8a60c26c7cb788fe181fb8db10e454b96dda23a9
tree984f91070e1703d652762ff56a83e0b7133357ea
parent3627ceb5e25cdecd1a8113a5028cc898a1424349
Fix broken smb_thread_once function

- We can't set *ponce=true before running the function because although other
  threads wouldn't re-run the initialization function, they could potentially
  proceed beyond the initialization point while the first thread was still
  running the initialization function. If a second thread gets to an
  SMB_THREAD_ONCE() call while one with the same ponce is running, we need to
  ensure that it enters smb_thread_once() to await the mutex and then recheck
  whether *ponce is set or not.  My original comment about other "once"
  functions possibly being called from within this "once" function is
  irrelevant since those other ones would have their own unique ponce.

Derrell
lib/util/smb_threads.c