|
libosip 3.6.0
|
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_MT_H_ 00021 #define _OSIP_MT_H_ 00022 00023 #ifdef OSIP_MT 00024 00025 #ifdef ENABLE_MPATROL 00026 #include <mpatrol.h> 00027 #endif 00028 00029 #include <stdio.h> 00030 #ifndef _WIN32_WCE 00031 #include <errno.h> 00032 #endif 00033 00048 #ifdef __cplusplus 00049 extern "C" { 00050 #endif 00051 00056 struct osip_thread; 00057 00064 struct osip_thread *osip_thread_create(int stacksize, 00065 void *(*func) (void *), void *arg); 00066 00071 int osip_thread_join(struct osip_thread *thread); 00072 00078 int osip_thread_set_priority(struct osip_thread *thread, int priority); 00082 void osip_thread_exit(void); 00083 00084 #ifdef __cplusplus 00085 } 00086 #endif 00087 00092 #ifdef __cplusplus 00093 extern "C" { 00094 #endif 00095 00100 struct osip_sem; 00101 00106 struct osip_sem *osip_sem_init(unsigned int value); 00111 int osip_sem_destroy(struct osip_sem *sem); 00116 int osip_sem_post(struct osip_sem *sem); 00122 int osip_sem_wait(struct osip_sem *sem); 00128 int osip_sem_trywait(struct osip_sem *sem); 00129 00130 00131 #ifdef __cplusplus 00132 } 00133 #endif 00134 00139 #ifdef __cplusplus 00140 extern "C" { 00141 #endif 00142 00147 struct osip_mutex; 00148 00152 struct osip_mutex *osip_mutex_init(void); 00157 void osip_mutex_destroy(struct osip_mutex *mut); 00162 int osip_mutex_lock(struct osip_mutex *mut); 00167 int osip_mutex_unlock(struct osip_mutex *mut); 00168 00169 #ifdef __cplusplus 00170 } 00171 #endif 00172 00173 #endif /* OSIP_MT */ 00174 #endif /* end of _THREAD_H_ */
1.7.3