Added some basic synchronization primitives and a thread pool wrapper.