1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Modernize Semaphore

- Based on C++11's `mutex` and `condition_variable`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
This commit is contained in:
Pedro J. Estébanez
2021-01-27 13:41:10 +01:00
parent 4ddcdc031b
commit 8f6a636ae7
37 changed files with 99 additions and 836 deletions

View File

@@ -37,7 +37,6 @@
#include "drivers/unix/dir_access_unix.h"
#include "drivers/unix/file_access_unix.h"
#include "drivers/unix/net_socket_posix.h"
#include "drivers/unix/semaphore_posix.h"
#include "drivers/unix/thread_posix.h"
#include "servers/visual_server.h"
@@ -121,12 +120,8 @@ void OS_Unix::initialize_core() {
#ifdef NO_THREADS
ThreadDummy::make_default();
SemaphoreDummy::make_default();
#else
ThreadPosix::make_default();
#if !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED)
SemaphorePosix::make_default();
#endif
#endif
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES);
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA);