Boost logo

Boost Users :

From: Peter Barker (newbarker_at_[hidden])
Date: 2008-08-24 18:09:15


Jean,

I'm not familiar with Boost.Thread yet, but the documentation for 1.36.0 suggests you can call the thread constructor with multiple arguments as you're doing. Docs for 1.35.0 don't mention that constructor so I wonder if you're using 1.35.0 or before, but reading documentation for 1.36.0?

As suggested by others, boost::bind looks like it'll help.

Regards,

Pete

--- On Sat, 23/8/08, Jean-Sebastien Stoezel <js.stoezel_at_[hidden]> wrote:

> From: Jean-Sebastien Stoezel <js.stoezel_at_[hidden]>
> Subject: [Boost-users] Passing an argument to threads (boost::thread)
> To: boost-users_at_[hidden]
> Date: Saturday, 23 August, 2008, 10:22 PM
> Hello,
>
> How to pass arguments to a thread?
>
> From the documentation I thought I could do this:
> mp_ProcessorListenerThread = new
> boost::thread(ProcessorListener, this);
>
> However I get the following error:
> 'boost::thread::thread' : no overloaded function
> takes 2 arguments
>
> Thanks,
> Jean
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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