mutex.h revision 26d20cd51c968e111b4122536825368a17b5ca82
49dbdb0186eb23d87d685b96eaefa9ec3c71d9b8David Lawrence * Copyright (C) 1998-2000 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * Permission to use, copy, modify, and distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * purpose with or without fee is hereby granted, provided that the above
1633838b8255282d10af15c5c84cee5a51466712Bob Halley * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
15a44745412679c30a6d022733925af70a38b715David Lawrence * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
15a44745412679c30a6d022733925af70a38b715David Lawrence * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
15a44745412679c30a6d022733925af70a38b715David Lawrence * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
15a44745412679c30a6d022733925af70a38b715David Lawrence * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
15a44745412679c30a6d022733925af70a38b715David Lawrence * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
15a44745412679c30a6d022733925af70a38b715David Lawrence * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington/* $Id: mutex.h,v 1.17 2000/12/29 18:19:52 bwelling Exp $ */
9c4f33b6718407e94d50dbfb4977e16d3f83de9dDavid Lawrence#include <isc/result.h> /* for ISC_R_ codes */
bf6d2e39124ab3d51c253f7acad9a4abef059be6Bob Halley/* XXX We could do fancier error handling... */
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington * Define ISC_MUTEX_PROFILE to turn on profiling of mutexes by line. When
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington * enabled, isc_mutex_stats() can be used to print a table showing the
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington * number of times each type of mutex was locked and the amount of time
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington * waiting to obtain the lock.
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington isc_mutex_lockprofile((mp), __FILE__, __LINE__)
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington#define isc_mutex_stats(fp) isc_mutex_statsprofile(fp);
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellingtonisc_mutex_lockprofile(isc_mutex_t *mp, const char * _file, int _line);
26d20cd51c968e111b4122536825368a17b5ca82Brian Wellington#endif /* ISC_MUTEX_PROFILE */
bf6d2e39124ab3d51c253f7acad9a4abef059be6Bob Halley#endif /* ISC_MUTEX_H */