dlz_pthread.h revision aefb3e308ba01ad47a3d3aaadf77a5edd4261cb9
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt/*
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt *
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * Permission to use, copy, modify, and/or distribute this software for any
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * purpose with or without fee is hereby granted, provided that the above
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * copyright notice and this permission notice appear in all copies.
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt *
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt * PERFORMANCE OF THIS SOFTWARE.
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt */
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#ifndef DLZ_PTHREAD_H
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define DLZ_PTHREAD_H 1
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#ifndef PTHREADS
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define PTHREADS 1
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#endif
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#ifdef PTHREADS
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_t pthread_mutex_t
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_init pthread_mutex_init
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_destroy pthread_mutex_destroy
aefb3e308ba01ad47a3d3aaadf77a5edd4261cb9Evan Hunt#define dlz_mutex_lock pthread_mutex_lock
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_trylock pthread_mutex_trylock
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_unlock pthread_mutex_unlock
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#else /* !PTHREADS */
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_t void
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_init(a, b) (0)
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_destroy(a) (0)
aefb3e308ba01ad47a3d3aaadf77a5edd4261cb9Evan Hunt#define dlz_mutex_lock(a) (0)
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_trylock(a) (0)
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#define dlz_mutex_unlock(a) (0)
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#endif
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt
72c86c105a7cf315036d7131a4ef408bc6227639Evan Hunt#endif /* DLZ_PTHREAD_H */