down with assert, up with osi_Assert
[openafs.git] / src / viced / viced.h
index a2e64db..09e2bf3 100644 (file)
@@ -195,17 +195,13 @@ extern int saneacls;
                                         * HostCheck, Signal, min 2 for RXSTATS */
 #ifdef AFS_PTHREAD_ENV
 #include <pthread.h>
-#include <assert.h>
+#include <afs/afs_assert.h>
 extern pthread_mutex_t fileproc_glock_mutex;
-#define FS_LOCK \
-    assert(pthread_mutex_lock(&fileproc_glock_mutex) == 0)
-#define FS_UNLOCK \
-    assert(pthread_mutex_unlock(&fileproc_glock_mutex) == 0)
+#define FS_LOCK MUTEX_ENTER(&fileproc_glock_mutex);
+#define FS_UNLOCK MUTEX_EXIT(&fileproc_glock_mutex);
 extern pthread_mutex_t fsync_glock_mutex;
-#define FSYNC_LOCK \
-    assert(pthread_mutex_lock(&fsync_glock_mutex) == 0)
-#define FSYNC_UNLOCK \
-    assert(pthread_mutex_unlock(&fsync_glock_mutex) == 0)
+#define FSYNC_LOCK MUTEX_ENTER(&fsync_glock_mutex);
+#define FSYNC_UNLOCK MUTEX_EXIT(&fsync_glock_mutex);
 #else /* AFS_PTHREAD_ENV */
 #define FS_LOCK
 #define FS_UNLOCK
@@ -248,11 +244,11 @@ extern struct fs_state fs_state;
 #ifdef AFS_NT40_ENV
 #define FS_STATE_INIT    fs_stateInit()
 #else
-#define FS_STATE_INIT    assert(pthread_rwlock_init(&fs_state.state_lock, NULL) == 0)
+#define FS_STATE_INIT    osi_Assert(pthread_rwlock_init(&fs_state.state_lock, NULL) == 0)
 #endif
-#define FS_STATE_RDLOCK  assert(pthread_rwlock_rdlock(&fs_state.state_lock) == 0)
-#define FS_STATE_WRLOCK  assert(pthread_rwlock_wrlock(&fs_state.state_lock) == 0)
-#define FS_STATE_UNLOCK  assert(pthread_rwlock_unlock(&fs_state.state_lock) == 0)
+#define FS_STATE_RDLOCK  osi_Assert(pthread_rwlock_rdlock(&fs_state.state_lock) == 0)
+#define FS_STATE_WRLOCK  osi_Assert(pthread_rwlock_wrlock(&fs_state.state_lock) == 0)
+#define FS_STATE_UNLOCK  osi_Assert(pthread_rwlock_unlock(&fs_state.state_lock) == 0)
 
 #define FS_MODE_NORMAL    0
 #define FS_MODE_SHUTDOWN  1