Added and implemented the Lock library calls.  Updated shell script and thread_example.c to use it