libosip  5.3.0
osip_mt.h
Go to the documentation of this file.
1 /*
2  The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3  Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 
20 #ifndef _OSIP_MT_H_
21 #define _OSIP_MT_H_
22 
23 #ifndef OSIP_MONOTHREAD
24 
25 #include <stdio.h>
26 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
49 struct osip_thread;
50 
57 struct osip_thread *osip_thread_create(int stacksize, void *(*func)(void *), void *arg);
58 
63 int osip_thread_join(struct osip_thread *thread);
64 
70 int osip_thread_set_priority(struct osip_thread *thread, int priority);
74 void osip_thread_exit(void);
75 
76 #ifdef __cplusplus
77 }
78 #endif
84 #ifdef __cplusplus
85 extern "C" {
86 #endif
87 
92 struct osip_sem;
93 
98 struct osip_sem *osip_sem_init(unsigned int value);
103 int osip_sem_destroy(struct osip_sem *sem);
108 int osip_sem_post(struct osip_sem *sem);
114 int osip_sem_wait(struct osip_sem *sem);
120 int osip_sem_trywait(struct osip_sem *sem);
121 
122 #ifdef __cplusplus
123 }
124 #endif
130 #ifdef __cplusplus
131 extern "C" {
132 #endif
133 
138 struct osip_mutex;
139 
148 void osip_mutex_destroy(struct osip_mutex *mut);
153 int osip_mutex_lock(struct osip_mutex *mut);
158 int osip_mutex_unlock(struct osip_mutex *mut);
159 
160 #ifdef __cplusplus
161 }
162 #endif
164 #endif /* OSIP_MONOTHREAD */
165 #endif /* end of _THREAD_H_ */
int osip_mutex_lock(struct osip_mutex *mut)
int osip_mutex_unlock(struct osip_mutex *mut)
struct osip_mutex * osip_mutex_init(void)
void osip_mutex_destroy(struct osip_mutex *mut)
int osip_sem_post(struct osip_sem *sem)
Definition: port_sema.c:187
int osip_sem_destroy(struct osip_sem *sem)
Definition: port_sema.c:176
struct osip_sem * osip_sem_init(unsigned int value)
Definition: port_sema.c:163
int osip_sem_trywait(struct osip_sem *sem)
Definition: port_sema.c:205
int osip_sem_wait(struct osip_sem *sem)
Definition: port_sema.c:196
void osip_thread_exit(void)
int osip_thread_set_priority(struct osip_thread *thread, int priority)
int osip_thread_join(struct osip_thread *thread)
struct osip_thread * osip_thread_create(int stacksize, void *(*func)(void *), void *arg)