rwlock.c revision a3002fd5a23b06733c6a98fd34a417099fe51cc4
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * Copyright (C) 1998 Internet Software Consortium.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * Permission to use, copy, modify, and distribute this software for any
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * purpose with or without fee is hereby granted, provided that the above
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * copyright notice and this permission notice appear in all copies.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
3db78e0855a8dfc162180880cd70d9c1a03d9301David Lawrenceprint_lock(char *operation, isc_rwlock_t *rwl, isc_rwlocktype_t type) {
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence (type == isc_rwlocktype_read ? "read" : "write"));
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence (rwl->type == isc_rwlocktype_read ? "reading" : "writing"),
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * In case there's trouble initializing, we zero magic now. If all
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence * goes well, we'll set it to RWLOCK_MAGIC.
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence "isc_mutex_init() failed: %s",
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence "isc_condition_init(readable) failed: %s",
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence result = isc_condition_init(&rwl->writeable);
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence "isc_condition_init(writeable) failed: %s",
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrenceisc_rwlock_lock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrenceisc_rwlock_unlock(isc_rwlock_t *rwl, isc_rwlocktype_t type) {
20bd7b4bbf2437ef2f9109edca168ab0ce8445b3David Lawrence /* Does this case ever happen? */