[haiku-commits] Re: r37696 - in haiku/trunk: headers/os/locale src/kits/locale

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 22 Jul 2010 20:32:07 +0200

On 2010-07-22 at 17:27:23 [+0200], Adrien Destugues 
<pulkomandy@xxxxxxxxxxxxxxxxx> wrote:
> > That's not thread safe. Either locking or atomic initialization
> > (__init_once()) are needed.
> 
> Can _init_once() handle the fact that the objects may be deleted and
> recreated (in the assignment operator) ?

You just have to reinitialize the guard variable. Concurrent access while 
doing that is not safe, though. If that shall be supported, a lock is the 
only option.

CU, Ingo

Other related posts: