Replace GtSemaphore by GtLock.