Re: [Cppcms-users] singleton per thread
Brought to you by:
artyom-beilis
|
From: Artyom <art...@ya...> - 2010-10-07 08:26:57
|
>
> The following simple code cause segmentation fault with both
> booster::thread_specific_ptr and boost::thread_specific_ptr versions
> when a client call "sum" rpc method.
Before you use the pointer you need to init it for each thread on first use:
if(!thread_int.get())
thread_int.reset(new int(0))
Read boost's documentation
Artyom
|