| Author |
Message |
|
|
Post subject: how to access the gui by thread function?
Posted: May 11, 2007 - 02:30 PM
|
|
Active Member
Joined: Aug 01, 2002
Posts: 15
Location: Germany
|
|
Hola,
In a photon application i got a thread which is controling a network connection. I want to write out this connection state into a widget at a dialog. If the thread calls PtSetResource() the the application crashes. I think it is because of missing thread safenes.
How could i write out the state instead?
Here is the actual method which failed:
-->THREAD1:
PtMainLoop( );
// on press connect button, i start the connection thread
pthread_create(THREAD2);
-->THREAD2:
if( connection_state == changed)
PtSetResource(ABW_output_widget); // crashes the application |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: how to access the gui by thread function?
Posted: May 11, 2007 - 02:48 PM
|
|
QNX Master
Joined: Sep 01, 2002
Posts: 2831
|
|
| Look at PtEnter and PtLeave, or have the second thread signal the first thread that some stuff needs to be refreshed. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: how to access the gui by thread function?
Posted: May 14, 2007 - 06:25 AM
|
|
Active Member
Joined: Aug 01, 2002
Posts: 15
Location: Germany
|
|
| Thanks, i found the tutorial "Parallel Operations" right now. |
|
|
| |
|
|
|
 |
|
|
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group Credits |
|
|