diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2016-09-18 02:38:01 +0200 |
commit | dc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch) | |
tree | 569a7f13128450bbab973236615587ff00bced5f /src/common/synchronized_wrapper.h | |
parent | Travis: Import Dolphin’s clang-format hook. (diff) | |
download | yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2 yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/synchronized_wrapper.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/common/synchronized_wrapper.h b/src/common/synchronized_wrapper.h index 07105a198..8dc4ddeac 100644 --- a/src/common/synchronized_wrapper.h +++ b/src/common/synchronized_wrapper.h @@ -12,14 +12,14 @@ namespace Common { /** * Wraps an object, only allowing access to it via a locking reference wrapper. Good to ensure no * one forgets to lock a mutex before acessing an object. To access the wrapped object construct a - * SyncronizedRef on this wrapper. Inspired by Rust's Mutex type (http://doc.rust-lang.org/std/sync/struct.Mutex.html). + * SyncronizedRef on this wrapper. Inspired by Rust's Mutex type + * (http://doc.rust-lang.org/std/sync/struct.Mutex.html). */ template <typename T> class SynchronizedWrapper { public: template <typename... Args> - SynchronizedWrapper(Args&&... args) : - data(std::forward<Args>(args)...) { + SynchronizedWrapper(Args&&... args) : data(std::forward<Args>(args)...) { } private: @@ -58,11 +58,19 @@ public: return *this; } - T& operator*() { return wrapper->data; } - const T& operator*() const { return wrapper->data; } + T& operator*() { + return wrapper->data; + } + const T& operator*() const { + return wrapper->data; + } - T* operator->() { return &wrapper->data; } - const T* operator->() const { return &wrapper->data; } + T* operator->() { + return &wrapper->data; + } + const T* operator->() const { + return &wrapper->data; + } private: SynchronizedWrapper<T>* wrapper; |