From b7659613b2eed5df47e3e7ec536012772cc08b61 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 18 Aug 2014 10:47:37 -0700 Subject: [PATCH] Remove androidGetTid. Bug: 17048545 Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4 --- include/utils/AndroidThreads.h | 3 --- include/utils/Thread.h | 4 ++-- libcutils/sched_policy.c | 4 ---- libutils/Threads.cpp | 9 --------- 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/include/utils/AndroidThreads.h b/include/utils/AndroidThreads.h index 4eee14d7e..3c640b6b6 100644 --- a/include/utils/AndroidThreads.h +++ b/include/utils/AndroidThreads.h @@ -73,9 +73,6 @@ extern void androidSetCreateThreadFunc(android_create_thread_fn func); // ------------------------------------------------------------------ // Extra functions working with raw pids. -// Get pid for the current thread. -extern pid_t androidGetTid(); - #ifdef HAVE_ANDROID_OS // Change the priority AND scheduling group of a particular thread. The priority // should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION diff --git a/include/utils/Thread.h b/include/utils/Thread.h index df3061135..c867e95a4 100644 --- a/include/utils/Thread.h +++ b/include/utils/Thread.h @@ -71,8 +71,8 @@ public: bool isRunning() const; #ifdef HAVE_ANDROID_OS - // Return the thread's kernel ID, same as the thread itself calling gettid() or - // androidGetTid(), or -1 if the thread is not running. + // Return the thread's kernel ID, same as the thread itself calling gettid(), + // or -1 if the thread is not running. pid_t getTid() const; #endif diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c index 9f092d6b3..12fc7341a 100644 --- a/libcutils/sched_policy.c +++ b/libcutils/sched_policy.c @@ -222,11 +222,9 @@ static int getSchedulerGroup(int tid, char* buf, size_t bufLen) int get_sched_policy(int tid, SchedPolicy *policy) { -#ifdef HAVE_GETTID if (tid == 0) { tid = gettid(); } -#endif pthread_once(&the_once, __initialize); if (__sys_supports_schedgroups) { @@ -261,11 +259,9 @@ int get_sched_policy(int tid, SchedPolicy *policy) int set_sched_policy(int tid, SchedPolicy policy) { -#ifdef HAVE_GETTID if (tid == 0) { tid = gettid(); } -#endif policy = _policy(policy); pthread_once(&the_once, __initialize); diff --git a/libutils/Threads.cpp b/libutils/Threads.cpp index b09d51068..03fde978b 100644 --- a/libutils/Threads.cpp +++ b/libutils/Threads.cpp @@ -306,15 +306,6 @@ void androidSetCreateThreadFunc(android_create_thread_fn func) gCreateThreadFn = func; } -pid_t androidGetTid() -{ -#ifdef HAVE_GETTID - return gettid(); -#else - return getpid(); -#endif -} - #ifdef HAVE_ANDROID_OS int androidSetThreadPriority(pid_t tid, int pri) {