Index: trunk/src/sh_hash.c
===================================================================
--- trunk/src/sh_hash.c	(revision 319)
+++ trunk/src/sh_hash.c	(revision 320)
@@ -1554,5 +1554,8 @@
 
   SL_ENTER(_("sh_hash_hashdelete"));
-  SH_MUTEX_LOCK(mutex_hash);
+
+  /* need deadlock detection here if called from exit handler 
+   */
+  SH_MUTEX_TRYLOCK(mutex_hash);
 
   if (IsInit == 0) 
@@ -1570,4 +1573,5 @@
   ; /* 'label at end of compound statement */
   SH_MUTEX_UNLOCK(mutex_hash);
+
   SL_RET0(_("sh_hash_hashdelete"));
 }
