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 » GuiLock and GuiUnlock objects are of different type.
GuiLock and GuiUnlock objects are of different type. [message #56195] Sun, 07 February 2021 17:49 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Hi,

GuiLock is defined as a struct, and GuiUnlock as a class. I think the source code should be consistent.

My recommendation:
class GuiLock { // <--- changed struct to class
public:         // <--- added.
        GuiLock()  { EnterGuiMutex(); }
        ~GuiLock() { LeaveGuiMutex(); }
};

class GuiUnlock {
	int n;

public:
	GuiUnlock()  { n = LeaveGuiMutexAll(); }
	~GuiUnlock() { EnterGuiMutex(n); }
};




Best regards,
Oblivion


 
Read Message
Read Message
Read Message
Previous Topic: Urr Data not properly returned in our case
Next Topic: How to Sync computer Time in a network?
Goto Forum:
  


Current Time: Sat May 04 22:49:37 CEST 2024

Total time taken to generate the page: 0.02314 seconds