1 /* $NetBSD: dlz_pthread.h,v 1.1.1.3 2014/12/10 03:34:31 christos Exp $ */ 2 3 /* 4 * Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") 5 * 6 * Permission to use, copy, modify, and/or distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 11 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 12 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 13 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 14 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 15 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #ifndef DLZ_PTHREAD_H 20 #define DLZ_PTHREAD_H 1 21 22 #ifndef PTHREADS 23 #define PTHREADS 1 24 #endif 25 26 #ifdef PTHREADS 27 #define dlz_mutex_t pthread_mutex_t 28 #define dlz_mutex_init pthread_mutex_init 29 #define dlz_mutex_destroy pthread_mutex_destroy 30 #define dlz_mutex_trylock pthread_mutex_trylock 31 #define dlz_mutex_unlock pthread_mutex_unlock 32 #else /* !PTHREADS */ 33 #define dlz_mutex_t void 34 #define dlz_mutex_init(a, b) (0) 35 #define dlz_mutex_destroy(a) (0) 36 #define dlz_mutex_trylock(a) (0) 37 #define dlz_mutex_unlock(a) (0) 38 #endif 39 40 #endif /* DLZ_PTHREAD_H */ 41