Executes the given action, acquiring a permit from this semaphore at the beginning and releasing it after the action is completed.
the return value of the action.