| | |
Passing argument to boost thread with boost bind
![]() |
•
•
Join Date: Dec 2008
Posts: 30
Reputation:
Solved Threads: 0
Hi,i am having problems passing arguments to a boost thread.I have tried using the boost::bind,it works without argument but when i try to pass arguments,it doesn't work.Here are my codes:
C++ Syntax (Toggle Plain Text)
class Parser { void Start(int a) { ... } void makeThread(int id) { boost::thread pThread(boost::bind(&Parser::Start,id)); //Problem here boost::thread::yield(); pThread.join(); }
![]() |
Similar Threads
- Function pointer suddenly causes segmentation fault (C++)
- Meta-programming, templates, virtual member functions (C++)
- Inconsistent (and wrong) output using boost::thread (C++)
- Passing a member function pointer (C++)
- Using CreateThread() function (C++)
- bost::bind performance (C++)
- detecting is boost::shared_ptr is NULL (C++)
- warning C4180 in vc8 using boost::weak_ptr (C++)
Other Threads in the C++ Forum
- Previous Thread: Symlink Windows?
- Next Thread: test score with pointer notation
Views: 1624 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for C++
algorithm api array arrays assignment basic beginner binary browser c++ c/c++ calculator char class classes code compile compiler constructor conversion convert count data delete desktop display dll dynamic encryption error file files form fstream function functions game givemetehcodez graph gui homework i/o iamthwee input int integer lazy library linker list loop loops map math matrix member memory network newbie news number object objects opengl output parameter pointer pointers problem program programming project random read recursion recursive reference sort sorting spoonfeeding string strings struct student studio template templates text time tree undefined variable vc++ vector video visual win32 window windows winsock





