diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 13:23:58 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
| commit | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch) | |
| tree | a27e497da7104dd0a64f98a04fa3067668735e91 /drivers/unix/rw_lock_posix.cpp | |
| parent | 710b34b70227becdc652b4ae027fe0ac47409642 (diff) | |
| download | redot-engine-0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a.tar.gz | |
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
Diffstat (limited to 'drivers/unix/rw_lock_posix.cpp')
| -rw-r--r-- | drivers/unix/rw_lock_posix.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/unix/rw_lock_posix.cpp b/drivers/unix/rw_lock_posix.cpp index f219a0905c..50b74e84f7 100644 --- a/drivers/unix/rw_lock_posix.cpp +++ b/drivers/unix/rw_lock_posix.cpp @@ -37,7 +37,6 @@ #include <stdio.h> void RWLockPosix::read_lock() { - int err = pthread_rwlock_rdlock(&rwlock); if (err != 0) { perror("Acquiring lock failed"); @@ -46,12 +45,10 @@ void RWLockPosix::read_lock() { } void RWLockPosix::read_unlock() { - pthread_rwlock_unlock(&rwlock); } Error RWLockPosix::read_try_lock() { - if (pthread_rwlock_tryrdlock(&rwlock) != 0) { return ERR_BUSY; } else { @@ -60,13 +57,11 @@ Error RWLockPosix::read_try_lock() { } void RWLockPosix::write_lock() { - int err = pthread_rwlock_wrlock(&rwlock); ERR_FAIL_COND(err != 0); } void RWLockPosix::write_unlock() { - pthread_rwlock_unlock(&rwlock); } @@ -79,23 +74,19 @@ Error RWLockPosix::write_try_lock() { } RWLock *RWLockPosix::create_func_posix() { - return memnew(RWLockPosix); } void RWLockPosix::make_default() { - create_func = create_func_posix; } RWLockPosix::RWLockPosix() { - //rwlock=PTHREAD_RWLOCK_INITIALIZER; fails on OSX pthread_rwlock_init(&rwlock, nullptr); } RWLockPosix::~RWLockPosix() { - pthread_rwlock_destroy(&rwlock); } |
