threading_cond.h

Go to the documentation of this file.
00001 #ifndef __threading_cond_h__
00002 #define __threading_cond_h__
00003 
00004 #include <pthread.h>
00005 
00006 #define cond_init(c) pthread_cond_init(c, NULL)
00007 #define cond_signal(c) pthread_cond_signal(c)
00008 #define cond_broadcast(c) pthread_cond_broadcast(c)
00009 #define cond_wait(c,m) pthread_cond_wait(c, m)
00010 #define cond_timedwait(c,m,t) pthread_cond_timedwait(c, m, t)
00011 
00012 #ifdef NDEBUG
00013 
00014 #define cond_destroy(c) pthread_cond_destroy(c)
00015 
00016 #else
00017 
00018 #include "common/assertions.h"
00019 
00020 // pthread_cond_destroy should likewise never produce an error unless
00021 // there is a coding error of some sort. The same is not true for
00022 // pthread_cond_timedwait.
00023 #define cond_destroy(c) assert(!pthread_cond_destroy(c))
00024 
00025 #endif
00026 
00027 #endif /* __threading_cond_h__ */
00028 
00029 /**
00030 
00031 threading_cond.h
00032 
00033 Copyright 2009 Helsinki Institute for Information Technology (HIIT)
00034 and the authors. All rights reserved.
00035 
00036 Authors: Tero Hasu <tero.hasu@hut.fi>
00037 
00038 Permission is hereby granted, free of charge, to any person
00039 obtaining a copy of this software and associated documentation files
00040 (the "Software"), to deal in the Software without restriction,
00041 including without limitation the rights to use, copy, modify, merge,
00042 publish, distribute, sublicense, and/or sell copies of the Software,
00043 and to permit persons to whom the Software is furnished to do so,
00044 subject to the following conditions:
00045 
00046 The above copyright notice and this permission notice shall be
00047 included in all copies or substantial portions of the Software.
00048 
00049 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00050 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00051 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00052 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00053 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00054 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00055 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00056 SOFTWARE.
00057 
00058  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:56 2011 by Doxygen 1.6.1