summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-04-29 17:13:32 -0700
committerChristopher Ferris <cferris@google.com>2015-05-13 13:43:32 -0700
commitcd206b3900639c44767cd892bccfbffabf222f67 (patch)
tree6e6d026aa1f4583f835f4610af7ad40e3ad31b6a /include
parentb33118ac7603b459d690f524e0c64161f8ab5c0d (diff)
downloadsystem_core-cd206b3900639c44767cd892bccfbffabf222f67.zip
system_core-cd206b3900639c44767cd892bccfbffabf222f67.tar.gz
system_core-cd206b3900639c44767cd892bccfbffabf222f67.tar.bz2
Fix gettid() on Windows.
Accidentally had this all hidden by an #ifndef _WIN32 when I wrote it. Bug: 19517541 (cherry picked from commit b3a36ca5ee79411c18984b85b224d9285b4468af) Change-Id: Ifbd5d19e506e7313700e2e29a2dae5736e049844
Diffstat (limited to 'include')
-rw-r--r--include/cutils/threads.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/include/cutils/threads.h b/include/cutils/threads.h
index 3133cdb..5727494 100644
--- a/include/cutils/threads.h
+++ b/include/cutils/threads.h
@@ -17,6 +17,14 @@
#ifndef _LIBS_CUTILS_THREADS_H
#define _LIBS_CUTILS_THREADS_H
+#include <sys/types.h>
+
+#if !defined(_WIN32)
+#include <pthread.h>
+#else
+#include <windows.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -29,10 +37,9 @@ extern "C" {
/***********************************************************************/
/***********************************************************************/
-#if !defined(_WIN32)
+extern pid_t gettid();
-#include <pthread.h>
-#include <sys/types.h>
+#if !defined(_WIN32)
typedef struct {
pthread_mutex_t lock;
@@ -40,14 +47,10 @@ typedef struct {
pthread_key_t tls;
} thread_store_t;
-extern pid_t gettid();
-
#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 }
#else // !defined(_WIN32)
-#include <windows.h>
-
typedef struct {
int lock_init;
int has_tls;