views:

56

answers:

1

hello.

Is there preferred way to initialize (lazily) singleton data when using multiple threads from boost.threads?

Thanks.

+4  A: 

Check out the call_once free function in Boost.Thread.

Emile Cormier
okay thanks.I just found it myself
aaa
You should check the answer anyway if it is the correct answer to your question.
Stewart
@Stewart there is time delay, I cannot accept right away
aaa