KosSemaphoreDeinit()

August 2, 2023

ID kos_semaphore_deinit

This function is declared in the kos/semaphore.h file.

Retcode KosSemaphoreDeinit(KosSemaphore *semaphore);

This function destroys the specified semaphore that was previously initialized by the KosSemaphoreInit() function.

It is safe to destroy an initialized semaphore on which there are currently no locked threads. There could be an unpredictable effect from destroying a semaphore on which other threads are currently locked.

The function returns the following:

  • rcOk if successful;
  • rcInvalidArgument, if the semaphore points to an invalid semaphore;
  • rcFail if there are threads being locked by this semaphore.

Did you find this article helpful?
What can we do better?
Thank you for your feedback! You're helping us improve.
Thank you for your feedback! You're helping us improve.