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 » Problem breaking loop (with close button) in main thread
Re: Problem breaking loop (with close button) in main thread [message #59039 is a reply to message #59034] Wed, 19 October 2022 01:11 Go to previous messageGo to previous message
awksed is currently offline  awksed
Messages: 68
Registered: April 2012
Member
Hi Lance,

Thanks for your reply.

Quote:

I am feeling your original code didnot prepare for the case when the WaitForSingleObject call actually succeeds


The function has worked perfectly for the last 5 years (about 5,000,000 calls) until the mutex was not acquired (which has happened only once - the other day).

GuiAcquireMutex() is called multiple times within a function (that calls many sub-functions - about 10,000 lines of code) called by Paint() to refresh the data required for Paint() to redraw 2 complex graphs. So PostCallback() would be rather difficult to implement.

I am probably being a little pedantic but I like my apps to fail gracefully rather than freeze for a minute before telling the user to restart it.

Thanks for your thoughts.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dealing with background tasks elegantly in a userinterface
Next Topic: error / memory leak in HttpServer example
Goto Forum:
  


Current Time: Sun May 11 17:24:21 CEST 2025

Total time taken to generate the page: 0.02491 seconds