Choco OS  V.0.16.9.0
Join to the chocolate world
oc_semaphore.h
Go to the documentation of this file.
1 
28 #ifndef INC_KERNEL_OC_SEMAPHORE_H_
29 #define INC_KERNEL_OC_SEMAPHORE_H_
30 
31 #include <stdbool.h>
32 #include <stdint.h>
33 #include <oc_time.h>
34 #include <oc_stdlib.h>
35 
41 #define _________________________________________TYPES_SECTION______________________________________________________________________________
42 
45 typedef struct Semaphore_t * oC_Semaphore_t;
46 
47 typedef enum
48 {
49  oC_Semaphore_Type_Binary = 1 ,
50  oC_Semaphore_Type_Counting = 0xFFFFFFFF
51 } oC_Semaphore_Type_t;
52 
53 typedef enum
54 {
55  oC_Semaphore_InitialValue_AllTaken = 0,
56  oC_Semaphore_InitialValue_GiveBinary = 1
57 } oC_Semaphore_InitialValue_t;
58 
59 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
60 
67 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
68 
71 extern oC_Semaphore_t oC_Semaphore_New ( oC_Semaphore_Type_t Type , oC_Semaphore_InitialValue_t InitialValue , Allocator_t Allocator , AllocationFlags_t Flags );
72 extern bool oC_Semaphore_Delete ( oC_Semaphore_t * Semaphore , AllocationFlags_t Flags );
73 extern bool oC_Semaphore_IsCorrect ( oC_Semaphore_t Semaphore );
74 extern bool oC_Semaphore_Give ( oC_Semaphore_t Semaphore );
75 extern bool oC_Semaphore_GiveCounting ( oC_Semaphore_t Semaphore , uint32_t Count );
76 extern bool oC_Semaphore_Take ( oC_Semaphore_t Semaphore , oC_Time_t Timeout );
77 extern bool oC_Semaphore_TakeCounting ( oC_Semaphore_t Semaphore , uint32_t Count , oC_Time_t Timeout );
78 
79 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
80 
82 #endif /* INC_KERNEL_OC_SEMAPHORE_H_ */
identifier for allocations
Definition: oc_stdlib.h:159
The library with time definitions.
static const oC_Allocator_t Allocator
Definition: oc_eth.c:152