Thread-safety and lazy-initialization of libraries

Sean Kelly via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 1 08:06:16 PDT 2014


On Monday, 30 June 2014 at 20:53:25 UTC, Sergey Protko wrote:
>
> Is there any proper way to do on-demand lazy-initialization of 
> used library, which will be also thread-safe? How do i need to 
> handle cases where some methods, which requires library to be 
> initialized, called from different threads at the same time?

pthread_once comes to mind.


More information about the Digitalmars-d-learn mailing list