summaryrefslogtreecommitdiff
path: root/src/utils/mutex.h
AgeCommit message (Collapse)AuthorFilesLines
2025-07-04Added logging priorities and use SDLs logging facilitiesThorbjørn Lindeijer1-2/+2
By using SDL logging, we can rely on SDL to filter the log messages by their priority before they get sent to our custom output function. For example, we now no longer get entries for created and destroyed Window instances by default, since these have only "debug" priority whereas the default priority for the "app" category is "info". We can also get log messages raised by SDL itself in our log now. Log levels can be controlled per category through the "SDL_LOGGING" environment variable. Many existing log messages have been assigned a category based on their existing prefix.
2025-03-01Further Download related cleanupsThorbjørn Lindeijer1-0/+39
* Moved the memory buffer and mutex handling into the Download class to simplify the code updating the UI in ServerDialog and UpdaterWindow. * Replaced the "DownloadUpdate" callback function with simply polling Download::getState, since in the end polling was happening anyway. This changes also fixes handling of the Enter key while downloading updates, which no longer cancels the update process. Also, when pressing Escape while things are being downloaded, the first press cancels and only the second press goes back to login. Introduced a ThreadSafe template class, which wraps any type and makes it only accessible by calling lock(). This ensures the data is never accessed without locking the relevant mutex.
2025-01-21Replaced include guards with #pragma onceThorbjørn Lindeijer1-4/+1
Thanks to https://github.com/cgmb/guardonce and a follow-up replace to remove duplicated newlines at end of file: find src -type f -name '*.h' -exec \ sed --in-place -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \; Source: https://unix.stackexchange.com/questions/81685/how-to-remove-multiple-newlines-at-eof Fixes compile on macOS, which appears to have been due to the EVENT_H include guard.
2024-02-13General code cleanupsThorbjørn Lindeijer1-6/+5
* Removing unused includes * Use member initialization * Use range-based for loops * Use nullptr * Removed no longer used aliases * Use override * Don't use else after return * Use '= delete' to remove implicit members * Use std::string::empty instead of comparing to ""
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-1/+1
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2024-01-25Always use C++11 and remove related compatibility option/codeThorbjørn Lindeijer1-4/+0
2012-03-24Introduced compile-time option to disable use of C++0xThorbjørn Lindeijer1-0/+5
This is in order to still support older compilers, in particular GCC 4.2.1, so that Mana may be compiled for Maemo 5. Reviewed-by: Yohann Ferreira
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2011-09-16Prevent copying of MutexLockerBen Longbons1-1/+11
There was a bug here, which wouldn't surface if the copy was elided. Fixed by using a move constructor. Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2009-03-26Changed includes in utils/ dictory to new guidelinesBjørn Lindeijer1-2/+2
2009-01-25Removed the TMW branding from header guardsBjørn Lindeijer1-3/+3
2009-01-23Removed unnecessary references to The Mana World in code headersBjørn Lindeijer1-4/+4
This dates back to the old days of TMW, but the usage instructions of GPLv2 don't mention this being necessary. Since it doesn't add anything, avoid the branding in these sections.
2008-12-05Fixed MutexLocker to not work on a copyBjørn Lindeijer1-5/+8
The Mutex class wasn't meant to be copied around. Silly last minute refactorings leading to untested code...
2008-12-05Fix race condition with a std::string accessBjørn Lindeijer1-0/+94
The downloading thread was writing to a std::string while the main thread was trying to draw it, for example. Now access to the label caption is guarded with a mutex. Should fix crashes while downloading updates.