*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.5 1997/09/22 18:14:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.6 1997/09/24 23:37:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define S_INIT_LOCK(lock) mutex_init(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
/* S_LOCK_FREE should return 1 if lock is free; 0 if lock is locked */
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
#define S_LOCK_FREE(alock) ((alock)->lock == 0)
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
#endif /* i86pc_solaris || sparc_solaris */
/*
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
#endif /* aix */
/*
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
static int
tas_dummy()
{
#define S_INIT_LOCK(addr) (*(addr) = 0)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
#endif /* NEED_SPARC_TAS_ASM */
/*
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
#endif /* NEED_I386_TAS_ASM */
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
#endif /* defined(__alpha__) && defined(linux) */
#if defined(linux) && defined(sparc)
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
+#define S_LOCK_FREE(lock) ((*lock) == 0)
+
#endif /* defined(linux) && defined(sparc) */
#if defined(linux) && defined(PPC)
#define S_INIT_LOCK(lock) S_UNLOCK(lock)
-#endif /* defined(linux) && defined(PPC) */
-
-#else /* HAS_TEST_AND_SET */
-
#define S_LOCK_FREE(lock) ((*lock) == 0)
+#endif /* defined(linux) && defined(PPC) */
+
#endif /* HAS_TEST_AND_SET */
#endif /* S_LOCK_H */