[Spread-cvs] commit: r458 - trunk/daemon

jschultz at spread.org jschultz at spread.org
Wed Jan 11 13:37:44 EST 2012


Author: jschultz
Date: 2012-01-11 13:37:42 -0500 (Wed, 11 Jan 2012)
New Revision: 458

Modified:
   trunk/daemon/monitor.c
Log:
Added changes to monitor to use mutex better (part of Once_execute clean up)


Modified: trunk/daemon/monitor.c
===================================================================
--- trunk/daemon/monitor.c	2012-01-10 19:55:41 UTC (rev 457)
+++ trunk/daemon/monitor.c	2012-01-11 18:37:42 UTC (rev 458)
@@ -121,7 +121,6 @@
 #ifdef	_REENTRANT
 
 #ifndef     ARCH_PC_WIN95
-    static      mutex_type	Init_mutex = MUTEX_STATIC_INIT;
     static      pthread_t	Read_thread;
     static      pthread_t	Status_thread;
     static      pthread_t	Partition_thread;
@@ -129,7 +128,6 @@
     static      void            *Status_send_thread_routine();
     static      void            *Partition_send_thread_routine();
 #else		/* ARCH_PC_WIN95 */
-    static	mutex_type	Init_mutex = {MUTEX_STATIC_INIT};
     static	HANDLE		Read_thread;
     static	HANDLE		Status_thread;
     static	HANDLE		Partition_thread;
@@ -290,20 +288,8 @@
 }
 static  void    initialize_locks(void)
 {
-        int ret;
-
-	ret = Mutex_trylock( &Init_mutex );
-	if( ret == 0 )
-	{
-		/* 
-		 * we managed to lock the Init_mutex. This means we are the first thread
-		 * to get here.
-		 */
-
-		Mutex_init( &Status_mutex );
-		Mutex_init( &Partition_mutex );
-        }
-        return;
+        Mutex_init( &Status_mutex );
+        Mutex_init( &Partition_mutex );
 }
 
 #ifdef	_REENTRANT




More information about the Spread-cvs mailing list