In the modern, multi-threaded, multi-core programming environment, correctly managing system resources such as locks and shared variables can be especially difficult and error-prone. A simple error, such as forgetting to release a lock, can have major consequences on the correct operation of the program (e.g. deadlock), often at a time and location that is isolated from the original error. Whil...