Boost logo

Boost Users :

Subject: Re: [Boost-users] Passing arguments to threads
From: Eric MALENFANT (Eric.Malenfant_at_[hidden])
Date: 2009-03-16 09:23:33


r ottmanj wrote:
>
> boost::thread dataThread(dparse.dataMain,instUUID); dataThread.join();
>
> However, when I attempt to use this, I get the following
> exception from my compiler.
[snip]

(Assuming instUUID is a string)

Without knowing what "dparse.dataMain" refers to, I can only speculate:
If dparse is a class name and dataMain a static method, or dparse is a namespace name and dataMain a function :
  boost::thread dataThread(&dparse::dataMain,instUUID);

If dparse is an instance name and dataMain is a non-static method, you have to pass the instance to call:
  boost::thread dataThread(&TypeOfdparse::dataMain, dparse, instUUID)

HTH,

Éric Malenfant


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net