# Unlocking a Semaphore

To unlock a semaphore that you've locked, use the `UnlockSemaphore()` function:

  `Err UnlockSemaphore( Item s )`

The `s` argument is the item number of the semaphore for the resource you want to unlock. The function returns 0 if successful or an error code (a negative value) if an error occurred. It returns the `NOTOWNER` error code if your task did not call `LockSemaphore()` for the specified semaphore.