OpenQNX :: The QNX Community Portal

Aug 21, 2008 - 06:32 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 49 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
robert
Post subject: how to access the gui by thread function?  PostPosted: 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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
mario
Post subject: RE: how to access the gui by thread function?  PostPosted: 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.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
robert
Post subject: RE: how to access the gui by thread function?  PostPosted: 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.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.