libosip 3.6.0

osip_condv.h

Go to the documentation of this file.
00001 /*
00002   The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
00003   Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Aymeric MOIZARD jack@atosc.org
00004   
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009   
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014   
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 #ifndef __OSIP_CONDV_H__
00021 #define __OSIP_CONDV_H__
00022 
00023 #include <stdio.h>
00024 
00025 #ifdef OSIP_MT
00026 
00027 #ifdef ENABLE_MPATROL
00028 #include <mpatrol.h>
00029 #endif
00030 
00045 #ifdef __cplusplus
00046 extern "C" {
00047 #endif
00048 
00049 #if defined(__PSOS__)
00050 
00051 /* TODO */
00052 
00053 #else
00054 
00055 
00056 /* condv implementation */
00057 #if defined(WIN32) || defined(_WIN32_WCE)
00058 /* Prevent struct redefinition if Pthreads for Win32 is used */
00059 #ifndef HAVE_STRUCT_TIMESPEC
00060 #define HAVE_STRUCT_TIMESPEC 1
00061 
00065         struct timespec {
00066                 long tv_sec;
00067                 long tv_nsec;
00068         };
00069 #endif
00070 #endif
00071 
00072         struct osip_cond;
00073 
00077         struct osip_cond *osip_cond_init(void);
00082         int osip_cond_destroy(struct osip_cond *cond);
00087         int osip_cond_signal(struct osip_cond *cond);
00088 
00094         int osip_cond_wait(struct osip_cond *cond, struct osip_mutex *mut);
00101         int osip_cond_timedwait(struct osip_cond *cond, struct osip_mutex *mut,
00102                                                         const struct timespec *abstime);
00103 
00104 
00105 #ifdef __cplusplus
00106 }
00107 #endif
00108 #endif
00109 
00110 #endif
00111 #endif