Implemented mutexes and additional gtthread functions