Recursive Mutex Wrapper.
A RecursiveMutex adds the ability to nest takes, so that if you have taken the RecursiveMutex and take it again, this works and requires you to give the RecursiveMutex back as many times as it was taken before it is released.
One very common application for this is for messages to the user on a console. Generally, you don't want pieces of a message interrupted by pieces of other messages, so message output routines use a mutex on the console port. These routines often use lower level routines that also want to make sure their output isn't interspersed, so each level takes the RecursiveMutex at their start and releases it at the end. Being a RecursiveMutex this works.
Example Usage:
mutex.take();
...
mutex.take();
...
mutex.give();
...
mutex.give();
Recursive Mutex Wrapper.
Definition MutexCPP.h:160