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 |
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.
|
|
|
Goto Forum:
Current Time: Mon Jun 17 07:50:14 CEST 2024
Total time taken to generate the page: 0.02095 seconds
|