A mutual exclusion primitive that relies on static type information only.
This library is inspired by this discussion.