TizenRT Libs&Environment  v2.0 M2
semaphore.h File Reference

Semaphore APIs. More...

#include <tinyara/config.h>
#include <stdint.h>
#include <limits.h>
Include dependency graph for semaphore.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  semholder_s
 Structure of semholder. More...
 
struct  sem_s
 Structure of generic semaphore. More...
 

Macros

#define PRIOINHERIT_FLAGS_DISABLE
 
#define FLAGS_INITIALIZED   (1 << 1) /* Bit 1: This semaphore initialized */
 
#define SEMHOLDER_INITIALIZER   {NULL, NULL, 0}
 
#define SEM_INITIALIZER(c)   {(c), FLAGS_INITIALIZED, NULL} /* semcount, flags, hhead */
 Sem initializer. More...
 
#define EXTERN   extern
 

Typedefs

typedef struct sem_s sem_t
 

Functions

int sem_init (FAR sem_t *sem, int pshared, unsigned int value)
 initialize an unnamed semaphore More...
 
int sem_destroy (FAR sem_t *sem)
 destroy an unnamed semaphore More...
 
int sem_wait (FAR sem_t *sem)
 lock a semaphore More...
 
int sem_timedwait (FAR sem_t *sem, FAR const struct timespec *abstime)
 lock a semaphore More...
 
int sem_trywait (FAR sem_t *sem)
 lock a semaphore More...
 
int sem_post (FAR sem_t *sem)
 unlock a semaphore More...
 
int sem_getvalue (FAR sem_t *sem, FAR int *sval)
 get the value of a semaphore More...
 
void sem_timeout (int argc, uint32_t pid)
 

Detailed Description

Semaphore APIs.

Definition in file semaphore.h.

Macro Definition Documentation

#define EXTERN   extern

Definition at line 156 of file semaphore.h.

#define FLAGS_INITIALIZED   (1 << 1) /* Bit 1: This semaphore initialized */

Definition at line 81 of file semaphore.h.

#define PRIOINHERIT_FLAGS_DISABLE
Value:
(1 << 0) /* Bit 0: Priority inheritance
* is disabled for this semaphore */

Definition at line 79 of file semaphore.h.

#define SEMHOLDER_INITIALIZER   {NULL, NULL, 0}

Definition at line 103 of file semaphore.h.

Typedef Documentation

typedef struct sem_s sem_t

Definition at line 130 of file semaphore.h.

Function Documentation

void sem_timeout ( int  argc,
uint32_t  pid 
)