libosip  5.3.0
osip_condv.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_CONDV_H__
21 #define __OSIP_CONDV_H__
22 
23 #include <stdio.h>
24 
25 #ifndef OSIP_MONOTHREAD
26 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #if defined(__PSOS__)
46 
47 /* TODO */
48 
49 #else
50 
51 /* condv implementation */
52 #if defined(WIN32) || defined(_WIN32_WCE)
53 /* Prevent struct redefinition if Pthreads for Win32 is used */
54 #if (_MSC_VER < 1900)
55 #ifndef HAVE_STRUCT_TIMESPEC
56 #define HAVE_STRUCT_TIMESPEC 1
61 struct timespec {
62  long tv_sec;
63  long tv_nsec;
64 };
65 #endif
66 #endif
67 #endif
68 
69 struct osip_cond;
70 
74 struct osip_cond *osip_cond_init(void);
79 int osip_cond_destroy(struct osip_cond *cond);
84 int osip_cond_signal(struct osip_cond *cond);
85 
91 int osip_cond_wait(struct osip_cond *cond, struct osip_mutex *mut);
98 int osip_cond_timedwait(struct osip_cond *cond, struct osip_mutex *mut, const struct timespec *abstime);
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 #endif
105 #endif
106 #endif
int osip_cond_destroy(struct osip_cond *cond)
int osip_cond_timedwait(struct osip_cond *cond, struct osip_mutex *mut, const struct timespec *abstime)
int osip_cond_signal(struct osip_cond *cond)
struct osip_cond * osip_cond_init(void)
int osip_cond_wait(struct osip_cond *cond, struct osip_mutex *mut)