Added more thread tests, including locking and race condition examples.