semaphore: LockThread implementation
semaphore: TryLockThread definition