Changeset 17069
- Timestamp:
- Mar 19, 2008, 2:49:00 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/gprint.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/gprint.c
r16902 r17069 152 152 } 153 153 154 static pthread_mutex_t set_file_mutex = PTHREAD_MUTEX_INITIALIZER; 155 154 156 void gprintSetFileAllThreads (gpDest dest, char *filename) { 155 157 156 158 int i; 159 160 /* need to use a mutex to prevent two threads from initing simultaneously */ 161 pthread_mutex_lock (&set_file_mutex); 157 162 158 163 for (i = 0; i < Nstreams; i++) { … … 160 165 gprintSetFile (&streams[i], dest, filename); 161 166 } 167 168 pthread_mutex_unlock (&set_file_mutex); 162 169 return; 163 170 } … … 168 175 stream = gprintGetStream (dest); 169 176 177 /* need to use a mutex to prevent two threads from initing simultaneously */ 178 pthread_mutex_lock (&set_file_mutex); 179 170 180 gprintSetFile (stream, dest, filename); 181 182 pthread_mutex_unlock (&set_file_mutex); 171 183 return; 172 184 }
Note:
See TracChangeset
for help on using the changeset viewer.
