[parisc-linux] db3 patch for Linux/HPPA
Jochen Friedrich
jochen@scram.de
Fri, 16 Aug 2002 07:54:04 +0200 (CEST)
Hi Matthew,
this fixes a problem with db3 mutexes. Problem is in
__db_tas_mutex_init(). If MUTEX_INIT returns non-zero value, mutexp->spins
doesn't get initialized and later __db_tas_mutex_lock loops without ever
trying to aquire the lock (as spins is zero).
diff -urN db-3.2.9/include/mutex.h db-3.2.9.new/include/mutex.h
--- db-3.2.9/include/mutex.h Sun Jun 23 16:34:28 2002
+++ db-3.2.9.new/include/mutex.h Sun Jun 23 16:33:38 2002
@@ -413,7 +413,7 @@
__r & 1; \
})
-#define MUTEX_UNSET(tsl) (*(tsl) = -1)
+#define MUTEX_UNSET(tsl) (!(*(tsl) = -1))
#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl)
#endif
#endif
Cheers,
--jochen