9 Mar
2006
9 Mar
'06
4:03 p.m.
Try the following inline changes. Sliwa, Przemyslaw (London) wrote:
I was though thread is created by a pointer to a function, e.g.
void AssignResult( Int& aRef, Int aVal ) { aRef = aVal; }
Int foo(int x, int y, int z) { // do something with a,b,c return a+b+c; }
Int lResult = 0;
Boost::thread pop( boost::bind( &AssignResult , boost::ref( lResult ) , boost::bind(&foo, a, b, c) ) );
// do something else
pop.join();
assert( lResult = foo( a, b, c ) ); is one possibilty. This has not been tested. The inner bind may need to be 'protected', see http://www.boost.org/libs/bind/bind.html#nested_binds. Jeff Flinn