/*
 * Copyright 03/21/95 Sun Microsystems, Inc.  All Rights Reserved.
 */

/*
 * This file gets included instead of the "real" synch.h when
 * compiling for lock_lint.  First it includes the real synch.h.
 * Then it undefines MUTEX_HELD, etc. so they can be recognized by the
 * compiler when using the -Zll flag.  Since they are no longer macros,
 * we must provide declarations for them.
 *
 * Macros NO_LOCKS_HELD and NO_COMPETING_THREADS are redefined so that
 * we can recognize assertions involving them.
 */

#ifndef _SYNCH_H

/*
 * Do NOT define _SYNCH_H here, we do not want to supress the
 * the expansion of synch.h by the private undocumented #pragma reinclude.
 * The private undocumented #pragma reinclude will include the next (real)
 * version of synch.h in the include path, this should be in /usr/sys.
 */

#pragma ident "@(#)synch.h 1.1 95/03/21 SMI"

#pragma reinclude

#undef MUTEX_HELD
#undef RW_READ_HELD
#undef RW_WRITE_HELD
#undef RW_LOCK_HELD

#ifdef __cplusplus
extern "C" {
#endif

extern int MUTEX_HELD(mutex_t *);
extern int RW_READ_HELD(rwlock_t *);
extern int RW_WRITE_HELD(rwlock_t *);
extern int RW_LOCK_HELD(rwlock_t *);

#undef  NO_LOCKS_HELD
#define NO_LOCKS_HELD \
	   __ASSERT__NO_LOCKS_HELD()
extern int __ASSERT__NO_LOCKS_HELD(void);

#undef  NO_COMPETING_THREADS
#define NO_COMPETING_THREADS \
	   __ASSERT__NO_COMPETING_THREADS()
extern int __ASSERT__NO_COMPETING_THREADS(void);

#ifdef __cplusplus
}
#endif

#endif  /* _SYNCH_H */
