reSIProcate/rutil  9694
vthread.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_VTHREAD_HXX)
00002 #define RESIP_VTHREAD_HXX 
00003 
00004 #ifdef WIN32
00005 #error this should not be used in win32 
00006 #endif
00007 
00008 #include <pthread.h>
00009 
00010 
00011 typedef pthread_t vthread_t;
00012 typedef pthread_mutex_t vmutex_t;
00013 typedef pthread_cond_t vcondition_t;
00014 typedef pthread_attr_t vthread_attr_t;    
00015 
00016 
00017 #define     vmutex_init(mutex) \
00018                 pthread_mutex_init((mutex),0)
00019                 
00020 
00021 #define     vmutex_destroy(mutex) \
00022                 pthread_mutex_destroy((mutex))
00023                 
00024 
00025 #define     vmutex_lock(mutex) \
00026                 pthread_mutex_lock((mutex))
00027 
00028 
00029 #define     vmutex_unlock(mutex) \
00030                 pthread_mutex_unlock((mutex))
00031                 
00032 
00033 #define     vcond_init(cond) \
00034                 pthread_cond_init((cond),0)
00035                 
00036 
00037 #define     vcond_destroy(cond) \
00038                 pthread_cond_destroy((cond))
00039                 
00040 
00041 #define     vcond_wait(cond, mutex) \
00042                 pthread_cond_wait((cond),(mutex))
00043 
00044 
00045 #define     vcond_timedwait(cond, mutex, timeout) \
00046                 pthread_cond_timedwait((cond),(mutex),(timeout))
00047 
00048 
00049 #define     vcond_signal(cond) \
00050                 pthread_cond_signal((cond))
00051 
00052 
00053 #define     vcond_broadcast(cond) \
00054                 pthread_cond_broadcast((cond))
00055                 
00056 #endif
00057 
00058 /* ====================================================================
00059  * The Vovida Software License, Version 1.0 
00060  * 
00061  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00062  * 
00063  * Redistribution and use in source and binary forms, with or without
00064  * modification, are permitted provided that the following conditions
00065  * are met:
00066  * 
00067  * 1. Redistributions of source code must retain the above copyright
00068  *    notice, this list of conditions and the following disclaimer.
00069  * 
00070  * 2. Redistributions in binary form must reproduce the above copyright
00071  *    notice, this list of conditions and the following disclaimer in
00072  *    the documentation and/or other materials provided with the
00073  *    distribution.
00074  * 
00075  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00076  *    and "Vovida Open Communication Application Library (VOCAL)" must
00077  *    not be used to endorse or promote products derived from this
00078  *    software without prior written permission. For written
00079  *    permission, please contact vocal@vovida.org.
00080  *
00081  * 4. Products derived from this software may not be called "VOCAL", nor
00082  *    may "VOCAL" appear in their name, without prior written
00083  *    permission of Vovida Networks, Inc.
00084  * 
00085  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00086  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00087  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00088  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00089  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00090  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00091  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00092  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00093  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00094  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00095  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00096  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00097  * DAMAGE.
00098  * 
00099  * ====================================================================
00100  * 
00101  * This software consists of voluntary contributions made by Vovida
00102  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00103  * Inc.  For more information on Vovida Networks, Inc., please see
00104  * <http://www.vovida.org/>.
00105  *
00106  */