|
Boost Users : |
From: Gabriel Weilenmann (G.Weilenmann_at_[hidden])
Date: 2007-09-27 14:48:22
Hi Everyone
I have a problem with threads which I don't understand. Well, it might be also connected to OpenCV, because it only occured while calling certain OpenCV functions so far:
void callCvShowImage()
{
// OpenCV function to display an image in a window.
cvShowImage("WindowName", image);
}
void callCvQueryFrame()
{
// OpenCV function to grab an image from a camera.
frame = cvQueryFrame( capture );
}
In a single thread program they work as expected:
...
callCvShowImage(); //Works well
callCvQueryFrame(); //Works well
...
In the multithreaded version they don't work. In my oppinion, exactly the same thing should happen as above. But surprisingly the functions suddenly don't execute anymore. thrdXX.join() block the program forever...
...
boost::thread thrdSI(&callCvShowImage());
thrdSI.join();
// the program never gets to this point
...
...
boost::thread thrdQF(&callCvQueryFrame());
thrdQF.join();
// the program never gets till here
...
Is there a way to fix this?
I could also use the thread library from Microsoft if you think this would help...
Obviously, I'm not much into threads. So please try to give me some examples together with your answer
Thanks to you people once more
Gabriel
-- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
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