Subject: Re: [boost] [threads / signals2] Win events replace by boost signals (threadsafe)
From: Norbert Wenzel (norbert.wenzel.lists_at_[hidden])
Date: 2015-03-23 07:08:38
On 03/23/2015 11:59 AM, Ben Pope wrote:
> On Monday, March 23, 2015 04:55 PM, Fu ji wrote:
>> int main()
>> boost::thread t1(SendSignal);
>> for (;;)
>> std::cout << ".";
>> auto c = signal.connect(() //...
> At this point the thread detaches and the process exits:
> You need to call t1.join() before exiting this scope.
That's true but the end of main() will never be reached (and also the
signal will never be connected) since the for(;;)-loop will print dots
and sleep forever before actually doing any work.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk