Boost::Thread: Joining without waiting



 DEVELOP > c-Plus-Plus > Boost::Thread: Joining without waiting

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
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!
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER