diff options
| author | Siva Chandra Reddy <sivachandra@google.com> | 2021-08-30 04:08:35 +0000 |
|---|---|---|
| committer | Siva Chandra Reddy <sivachandra@google.com> | 2021-08-30 04:08:35 +0000 |
| commit | f7e572b4f4a0339162f8bc168edfd9fa523c9c1e (patch) | |
| tree | 69379dd123b36ac66b853922b817701e54bca488 /libc/src/threads | |
| parent | 80f7ce89938874fb6b40ca5bafa1f5c4eca4746d (diff) | |
[libc][NFC] Add a check to catch mismatch in internal and public mutex types.
Diffstat (limited to 'libc/src/threads')
| -rw-r--r-- | libc/src/threads/linux/Mutex.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/src/threads/linux/Mutex.h b/libc/src/threads/linux/Mutex.h index 454b8ced3054..f6033c92eaf6 100644 --- a/libc/src/threads/linux/Mutex.h +++ b/libc/src/threads/linux/Mutex.h @@ -107,6 +107,10 @@ struct Mutex { } }; +static_assert(sizeof(Mutex) == sizeof(mtx_t), + "Sizes of internal representation of mutex and the public mtx_t " + "do not match."); + class MutexLock { Mutex *mutex; |
