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.
Re: GuiLock and GuiUnlock objects are of different type. [message #56196 is a reply to message #56195] Sun, 07 February 2021 17:58 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14257
Registered: November 2005
Ultimate Member
Oblivion wrote on Sun, 07 February 2021 17:49
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


IDK. I am using struct in almost all cases where either all members are naturally public or I do not care about hiding by private (which is 99% of time in end applications). Is that wrong? For me the difference between struct and class is the default access, nothing else...

 
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 10 02:58:10 CEST 2025

Total time taken to generate the page: 0.00842 seconds