Add the signal catcher (for SIGQUIT and SIGUSR1).

Also fix some of the thread implementation.

Change-Id: If2d1b59a149ba1ac192ad9bc74319c8dff228549
diff --git a/src/utils.cc b/src/utils.cc
index fd30a36..84b1556 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -25,6 +25,15 @@
   return contents;
 }
 
+std::string GetIsoDate() {
+  time_t now = time(NULL);
+  struct tm tmbuf;
+  struct tm* ptm = localtime_r(&now, &tmbuf);
+  return StringPrintf("%04d-%02d-%02d %02d:%02d:%02d",
+      ptm->tm_year + 1900, ptm->tm_mon+1, ptm->tm_mday,
+      ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
+}
+
 std::string PrettyDescriptor(const String* java_descriptor) {
   std::string descriptor(java_descriptor->ToModifiedUtf8());