Home » U++ Library support » U++ MT-multithreading and servers » Problem breaking loop (with close button) in main thread
Re: Problem breaking loop (with close button) in main thread [message #59040 is a reply to message #59039] |
Wed, 19 October 2022 02:21   |
Lance
Messages: 656 Registered: March 2007
|
Contributor |
|
|
Hi Awksed:
My bad. Your code goto again; only when WaitForSingleEvent fails. I was thinking in the context that it has been converted into a while loop. 
Quote:
Is there some way in U++ to allow the close button to call Close() while the main thread is looping
(like Windows PumpWaitingMessages())?
I would use ProcessEvents() in the loop. No idea how it will cause failure in your case. Maybe you can add a flag in Paint() to not call GuiAcquireMutex(..) again if there is a previous call not completed yet?
I would think the ProcessEvents should be inserted somewhere in your GuiAcquireMutex function (before jump back to again maybe), but it's somewhere else needs to be changed accordingly if problem arose because of it.
[Updated on: Wed, 19 October 2022 02:22] Report message to a moderator
|
|
|
 |
|
Problem breaking loop (with close button) in main thread
By: awksed on Tue, 18 October 2022 17:19
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Lance on Tue, 18 October 2022 19:15
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Lance on Tue, 18 October 2022 20:09
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: awksed on Wed, 19 October 2022 01:11
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Lance on Wed, 19 October 2022 02:21
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Lance on Wed, 19 October 2022 02:42
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: awksed on Wed, 19 October 2022 20:56
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Lance on Thu, 20 October 2022 01:04
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Oblivion on Thu, 20 October 2022 20:10
|
 |
|
Re: Problem breaking loop (with close button) in main thread
By: Lance on Thu, 20 October 2022 21:49
|
Goto Forum:
Current Time: Mon May 12 11:17:07 CEST 2025
Total time taken to generate the page: 0.00904 seconds
|