SIP Witch 1.9.15
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-2012 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 
52 /* condv implementation */
53 #if defined(WIN32) || defined(_WIN32_WCE)
54 /* Prevent struct redefinition if Pthreads for Win32 is used */
55 #ifndef HAVE_STRUCT_TIMESPEC
56 #define HAVE_STRUCT_TIMESPEC 1
57 
61  struct timespec {
62  long tv_sec;
63  long tv_nsec;
64  };
65 #endif
66 #endif
67 
68  struct osip_cond;
69 
73  struct osip_cond *osip_cond_init (void);
78  int osip_cond_destroy (struct osip_cond *cond);
83  int osip_cond_signal (struct osip_cond *cond);
84 
90  int osip_cond_wait (struct osip_cond *cond, struct osip_mutex *mut);
97  int osip_cond_timedwait (struct osip_cond *cond, struct osip_mutex *mut, const struct timespec *abstime);
98 
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 #endif
104 
105 #endif
106 #endif
int osip_cond_signal(struct osip_cond *cond)
Signal the condition variable.
int osip_cond_wait(struct osip_cond *cond, struct osip_mutex *mut)
Wait on the condition variable.
int osip_cond_timedwait(struct osip_cond *cond, struct osip_mutex *mut, const struct timespec *abstime)
Timed wait on the condition variable.
int osip_cond_destroy(struct osip_cond *cond)
Destroy a condition variable.
struct osip_cond * osip_cond_init(void)
Allocate and Initialise a condition variable.
Structure for referencing a mutex element.