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

Modernize RWLock

- Based on C++14's `shared_time_mutex`
- 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-25 19:48:38 +01:00
parent 96a3f01ac5
commit b450036120
23 changed files with 119 additions and 552 deletions

View File

@@ -38,7 +38,6 @@
#include "drivers/unix/file_access_unix.h"
#include "drivers/unix/mutex_posix.h"
#include "drivers/unix/net_socket_posix.h"
#include "drivers/unix/rw_lock_posix.h"
#include "drivers/unix/semaphore_posix.h"
#include "drivers/unix/thread_posix.h"
#include "servers/visual_server.h"
@@ -124,14 +123,12 @@ void OS_Unix::initialize_core() {
ThreadDummy::make_default();
SemaphoreDummy::make_default();
MutexDummy::make_default();
RWLockDummy::make_default();
#else
ThreadPosix::make_default();
#if !defined(OSX_ENABLED) && !defined(IPHONE_ENABLED)
SemaphorePosix::make_default();
#endif
MutexPosix::make_default();
RWLockPosix::make_default();
#endif
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES);
FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA);