Fixed bug in multithread implementation lock for barriers. Added multithread support Unit test