Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » How do I create a loop for a window to react to volatile changes to a global variable?
How do I create a loop for a window to react to volatile changes to a global variable? [message #51334] Mon, 11 March 2019 09:49 Go to previous message
slashupp is currently offline  slashupp
Messages: 231
Registered: July 2009
Experienced Member
The problem:
I have some global variables get&set by detached threads, using mutexes when getting and setting them.
I have a window that need to update it's display based on changes in the variables, also using the mutexes to get & set the values.
The changes are volatile/random/unpredictable ...

What I tried:
I passed a pointer to the window to the threads when I create them, and use the pointer to call methods
in the window to do the updates
Result: the app crashes with:
"... Using GUI in non-main thread without GuiLock"
I added "GuiLock __;" in the methods but then get:
"Assertion failed in ..../CtrlCore/GtkCapture.cpp, line 41 IsMainThread()"

(I know that this same code did work with an older release of Upp, but is now broken)
Any ideas on how I can fix this would be much appreciated.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: AsyncWork, IsFinished() may not be working properly
Next Topic: Encoding URL for HttpRequest
Goto Forum:
  


Current Time: Tue Apr 23 20:28:00 CEST 2024

Total time taken to generate the page: 0.01390 seconds