diff src/recpt1.c @ 185:7a0f498af035 default tip

Fix a race condition.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Wed, 14 May 2014 22:43:57 +0900
parents dc0d3addfd18
children
line wrap: on
line diff
--- a/src/recpt1.c	Fri May 09 21:30:46 2014 +0900
+++ b/src/recpt1.c	Wed May 14 22:43:57 2014 +0900
@@ -204,6 +204,7 @@
             pthread_mutex_lock(&tdata->splitter_mutex);
             split_shutdown(splitter);
             splitter = split_startup(sid_list);
+            time(&splitter->split_start_time);
             if (splitter->sid_list == NULL) {
                 fprintf (stderr, "reader_func() splitter RESTART FAILED.\n");
                 tdata->splitter = NULL;
@@ -231,7 +232,6 @@
             }
             tdata->table    = table;
             tdata->splitter = splitter;
-            time(&splitter->split_start_time);
             strncpy(tdata->sid_list, sid_list, sizeof(tdata->sid_list));
             pthread_mutex_unlock(&tdata->splitter_mutex);
         }