| Topic: |
DEVELOP > c-Plus-Plus |
| User: |
"Hans Mull" |
| Date: |
31 Jan 2008 08:33:53 AM |
| Object: |
Boost::Thread: Joining without waiting |
Hi!
I'm experimenting with boost::thread. I have a GUI application with a
slot function:
void someFunction(){...}
void Frame::OnOkButtonClick(...)
{
switch(someInteger)
{
case 0: break
case 1:
{
boost::thread mthTread(&someFunction);
mthTread.join();
break;
}
default: break
}
}
The program compiles and runs properly, but the GUI doesn't react
(Well, this is what to expect with this code because it waits for the
Thread to finish).
How can I make the program not to wait until the thread is finished?
Thanks in advance!
Kind regards, Hans
.
|
|
| User: "Michael DOUBEZ" |
|
| Title: Re: Boost::Thread: Joining without waiting |
31 Jan 2008 09:23:04 AM |
|
|
Hans Mull a écrit :
Hi!
I'm experimenting with boost::thread. I have a GUI application with a
slot function:
void someFunction(){...}
void Frame::OnOkButtonClick(...)
{
switch(someInteger)
{
case 0: break
case 1:
{
boost::thread mthTread(&someFunction);
mthTread.join();
break;
}
default: break
}
}
The program compiles and runs properly, but the GUI doesn't react
(Well, this is what to expect with this code because it waits for the
Thread to finish).
How can I make the program not to wait until the thread is finished?
Don't call join(). The thread will remain in detached state.
Michael
.
|
|
|
| User: "Hans Mull" |
|
| Title: Re: Boost::Thread: Joining without waiting |
31 Jan 2008 09:44:57 AM |
|
|
Michael DOUBEZ schrieb:
Hans Mull a écrit :
Hi!
I'm experimenting with boost::thread. I have a GUI application with a
slot function:
void someFunction(){...}
void Frame::OnOkButtonClick(...)
{
switch(someInteger)
{
case 0: break
case 1:
{
boost::thread mthTread(&someFunction);
mthTread.join();
break;
}
default: break
}
}
The program compiles and runs properly, but the GUI doesn't react
(Well, this is what to expect with this code because it waits for the
Thread to finish).
How can I make the program not to wait until the thread is finished?
Don't call join(). The thread will remain in detached state.
Michael
Thar worked well, thank you!
.
|
|
|
|
|

|
Related Articles |
|
|