Implementing mutex. This is a not working commit.
This code fails test. Not sure why.
This code now works - Forgot to add ready threads to ready list.
Removed unnecessary code.