view Resources/Patches/glog-utilities-lsb.diff @ 1127:f4e65808ea58

FilesystemStorageWithoutDicom
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 05 Sep 2014 17:12:08 +0200
parents ded40a9e8cc8
children
line wrap: on
line source

--- utilities.cc.orig	2012-01-12 09:40:21.000000000 +0100
+++ utilities.cc	2013-09-23 17:37:35.033275313 +0200
@@ -233,40 +233,7 @@
 }
 
 pid_t GetTID() {
-  // On Linux and FreeBSD, we try to use gettid().
-#if defined OS_LINUX || defined OS_FREEBSD || defined OS_MACOSX
-#ifndef __NR_gettid
-#ifdef OS_MACOSX
-#define __NR_gettid SYS_gettid
-#elif ! defined __i386__
-#error "Must define __NR_gettid for non-x86 platforms"
-#else
-#define __NR_gettid 224
-#endif
-#endif
-  static bool lacks_gettid = false;
-  if (!lacks_gettid) {
-    pid_t tid = syscall(__NR_gettid);
-    if (tid != -1) {
-      return tid;
-    }
-    // Technically, this variable has to be volatile, but there is a small
-    // performance penalty in accessing volatile variables and there should
-    // not be any serious adverse effect if a thread does not immediately see
-    // the value change to "true".
-    lacks_gettid = true;
-  }
-#endif  // OS_LINUX || OS_FREEBSD
-
-  // If gettid() could not be used, we use one of the following.
-#if defined OS_LINUX
-  return getpid();  // Linux:  getpid returns thread ID when gettid is absent
-#elif defined OS_WINDOWS || defined OS_CYGWIN
-  return GetCurrentThreadId();
-#else
-  // If none of the techniques above worked, we use pthread_self().
   return (pid_t)(uintptr_t)pthread_self();
-#endif
 }
 
 const char* const_basename(const char* filepath) {
@@ -295,7 +262,7 @@
     g_my_user_name = "invalid-user";
   }
 }
-REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer());
+REGISTER_MODULE_INITIALIZER(utilities, MyUserNameInitializer())
 
 #ifdef HAVE_STACKTRACE
 void DumpStackTraceToString(string* stacktrace) {