1 /* 2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 3 * 4 * SPDX-License-Identifier: ISC 5 * 6 * Permission to use, copy, modify, and distribute this software for any purpose 7 * with or without fee is hereby granted, provided that the above copyright 8 * notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 11 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 12 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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 OR 15 * 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 /* ifndef PTHREADS */ 25 26 #ifdef PTHREADS 27 #include <pthread.h> 28 #define dlz_mutex_t pthread_mutex_t 29 #define dlz_mutex_init pthread_mutex_init 30 #define dlz_mutex_destroy pthread_mutex_destroy 31 #define dlz_mutex_lock pthread_mutex_lock 32 #define dlz_mutex_trylock pthread_mutex_trylock 33 #define dlz_mutex_unlock pthread_mutex_unlock 34 #else /* !PTHREADS */ 35 #define dlz_mutex_t void 36 #define dlz_mutex_init(a, b) (0) 37 #define dlz_mutex_destroy(a) (0) 38 #define dlz_mutex_lock(a) (0) 39 #define dlz_mutex_trylock(a) (0) 40 #define dlz_mutex_unlock(a) (0) 41 #endif /* ifdef PTHREADS */ 42 43 #endif /* DLZ_PTHREAD_H */ 44