[Thread]: code snippet simulating future
Hi folks,
To better understand the "future" concept, I am looking at the following
code and have several questions:
(1) I got a compiling warning: 'this' : used in base member initializer
list. How can I get rid of it?
(2) how can I bind class's local data x_ into the new thread? I tried:
t_(boost::bind(&future<T>::run, this, x_) ), but it does not work.
(3) There seems a race condition in the overloaded function call
operator()(). What wrong did I do?
BTW: if the future is constructed as ctor using:
future(boost::function
participants (1)
-
Boost lzw