| | |
Passing argument to boost thread with boost bind
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
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
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count database delete deploy developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





