xref: /haiku/headers/private/kernel/posix/realtime_sem.h (revision 364d52c513a164097dc94c00f2d44c18bde5f729)
1 /*
2  * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef KERNEL_REALTIME_SEM_H
6 #define KERNEL_REALTIME_SEM_H
7 
8 #include <semaphore.h>
9 #include <sys/cdefs.h>
10 #include <sys/types.h>
11 
12 #include <OS.h>
13 
14 #include <posix/realtime_sem_defs.h>
15 
16 
17 struct realtime_sem_context;
18 
19 
20 __BEGIN_DECLS
21 
22 void		realtime_sem_init();
23 void		delete_realtime_sem_context(struct realtime_sem_context* context);
24 struct realtime_sem_context* clone_realtime_sem_context(
25 					struct realtime_sem_context* context);
26 
27 status_t	_user_realtime_sem_open(const char* name, int openFlagsOrShared,
28 					mode_t mode, uint32 semCount, sem_t* userSem,
29 					sem_t** _usedUserSem);
30 status_t	_user_realtime_sem_close(sem_id semID, sem_t** _deleteUserSem);
31 status_t	_user_realtime_sem_unlink(const char* name);
32 
33 status_t	_user_realtime_sem_get_value(sem_id semID, int* value);
34 status_t	_user_realtime_sem_post(sem_id semID);
35 status_t	_user_realtime_sem_wait(sem_id semID, uint32 flags,
36 					bigtime_t timeout);
37 
38 __END_DECLS
39 
40 
41 #endif	// KERNEL_REALTIME_SEM_H
42