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.

(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)


Éric Malenfant

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