semaphore: add a prototype of sem_tickwait
Prototype of this API is missing. We add it here because this isn't
a standard API.
****************************************************************************/
#include <tinyara/config.h>
-
#include <semaphore.h>
-
#include <tinyara/fs/fs.h>
+#include <tinyara/clock.h>
/****************************************************************************
* Pre-processor Definitions
@@ -110,6 +109,36 @@ extern "C" {
* Public Function Prototypes
****************************************************************************/
+/****************************************************************************
+ * Name: sem_tickwait
+ *
+ * Description:
+ * This function is a lighter weight version of sem_timedwait(). It is
+ * non-standard and intended only for use within the RTOS.
+ *
+ * Parameters:
+ * sem - Semaphore object
+ * start - The system time that the delay is relative to. If the
+ * current time is not the same as the start time, then the
+ * delay will be adjust so that the end time will be the same
+ * in any event.
+ * delay - Ticks to wait from the start time until the semaphore is
+ * posted. If ticks is zero, then this function is equivalent
+ * to sem_trywait().
+ *
+ * Return Value:
+ * Zero (OK) is returned on success.
+ * On failure, -1 (ERROR) is returned and the errno
+ * is set appropriately:
+ *
+ * ETIMEDOUT The semaphore could not be locked before the specified timeout
+ * (delay) expired.
+ * ENOMEM Out of memory
+ *
+ ****************************************************************************/
+
+int sem_tickwait(FAR sem_t *sem, systime_t start, uint32_t delay);
+
/****************************************************************************
* Name: sem_reset
*
