Boost logo

Boost Users :

From: Patrick (patrick_at_[hidden])
Date: 2006-01-27 10:52:43

Hello Sliwa,

This should do it.


class Simple


      Simple() : th(boost::bind(&Simple::run, boost::ref(*this)))



      void run()



                  //Thread's work goes here.





      boost::thread th;




From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Sliwa, Przemyslaw
Sent: Friday, January 27, 2006 4:25 AM
To: boost-users_at_[hidden]
Subject: [Boost-users] Spawning a thread on a member function




Does anyone know how to spawn a thread on member function of an existing
object in its constructor.

Clearly simple boost::bind does not work. I do not know how to tell the
compiler it must take the member function.


Thanks for help,




Kind regards



Przemyslaw Sliwa
Global Foreign Exchange

FX Risk Engine Development
Merrill Lynch
*** +44 (0)20 7995 4182
* +44 (0)79 6325 2319
*** Email: przemyslaw_sliwa_at_[hidden]



If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain
or redistribute it. Click here <> for
important additional terms relating to this e-mail.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at