summaryrefslogtreecommitdiff
path: root/core/os/rw_lock.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/rw_lock.h')
-rw-r--r--core/os/rw_lock.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h
index e519cea439..1035072cce 100644
--- a/core/os/rw_lock.h
+++ b/core/os/rw_lock.h
@@ -57,12 +57,14 @@ class RWLockRead {
public:
RWLockRead(const RWLock *p_lock) {
lock = const_cast<RWLock *>(p_lock);
- if (lock)
+ if (lock) {
lock->read_lock();
+ }
}
~RWLockRead() {
- if (lock)
+ if (lock) {
lock->read_unlock();
+ }
}
};
@@ -72,12 +74,14 @@ class RWLockWrite {
public:
RWLockWrite(RWLock *p_lock) {
lock = p_lock;
- if (lock)
+ if (lock) {
lock->write_lock();
+ }
}
~RWLockWrite() {
- if (lock)
+ if (lock) {
lock->write_unlock();
+ }
}
};