Skip to content

Commit

Permalink
[libc][NFC] Add a check to catch mismatch in internal and public mute…
Browse files Browse the repository at this point in the history
…x types.
  • Loading branch information
Siva Chandra Reddy committed Aug 30, 2021
1 parent 80f7ce8 commit f7e572b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libc/src/threads/linux/Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f7e572b

Please sign in to comment.