Commit Graph

4 Commits

Author SHA1 Message Date
Matthew Heon 35cc71a9e8 Improve documentation and unit tests for SHM locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 52d95f5072 Propogate error codes from SHM lock creation and open
Also add a few more unit tests

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon b489feff71 Add mutex invariant to SHM semaphores.
Check value of semaphores when incrementing to ensure we never go
beyond 1, preserving mutex invariants.

Also, add cleanup code to the lock tests, ensuring that we never
leave the locks in a bad state after a test. We aren't destroying
and recreating the SHM every time, so we have to be careful not
to leak state between test runs.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00
Matthew Heon 27cebb780b Initial skeleton of in-memory locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2019-01-04 09:45:59 -05:00