mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[mutex] Delete copy constructors
This commit is contained in:
parent
caa9cf2e85
commit
6b0124284b
1 changed files with 6 additions and 0 deletions
|
@ -99,6 +99,8 @@ struct hb_mutex_t
|
|||
|
||||
hb_mutex_t () { init (); }
|
||||
~hb_mutex_t () { fini (); }
|
||||
hb_mutex_t (const hb_mutex_t &) = delete;
|
||||
hb_mutex_t &operator= (const hb_mutex_t &) = delete;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
@ -114,6 +116,10 @@ struct hb_lock_t
|
|||
hb_lock_t (hb_mutex_t &mutex_) : mutex (&mutex_) { mutex->lock (); }
|
||||
hb_lock_t (hb_mutex_t *mutex_) : mutex (mutex_) { if (mutex) mutex->lock (); }
|
||||
~hb_lock_t () { if (mutex) mutex->unlock (); }
|
||||
|
||||
hb_lock_t (const hb_lock_t &) = delete;
|
||||
hb_lock_t &operator= (const hb_lock_t &) = delete;
|
||||
|
||||
private:
|
||||
hb_mutex_t *mutex;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue