Added headers and mutex typedefinitions to threads.h