Index: /trunk/Ohana/src/opihi/lib.shell/gprint.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/gprint.c	(revision 15029)
+++ /trunk/Ohana/src/opihi/lib.shell/gprint.c	(revision 15030)
@@ -30,4 +30,6 @@
 static int Nstreams = 0;
 
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
 void gprintInit () {
 
@@ -36,4 +38,6 @@
 
   /* need to use a mutex to prevent two threads from initing simultaneously */
+  pthread_mutex_lock (&mutex);
+
   if (streams == NULL) {
     Nstreams = 2;
@@ -66,4 +70,6 @@
   streams[N].mode = GP_FILE;
   streams[N].thread = id;
+
+  pthread_mutex_unlock (&mutex);
 }
 
