Loading core/jni/android_util_Process.cpp +1 −12 Original line number Diff line number Diff line Loading @@ -38,18 +38,7 @@ #include <grp.h> #include <pwd.h> #include <signal.h> /* desktop Linux needs a little help with gettid() */ #if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS) #define __KERNEL__ # include <linux/unistd.h> #ifdef _syscall0 _syscall0(pid_t,gettid) #else pid_t gettid() { return syscall(__NR_gettid);} #endif #undef __KERNEL__ #endif #include <unistd.h> #define POLICY_DEBUG 0 #define GUARD_THREAD_PRIORITY 0 Loading media/libmedia/AudioSystem.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -25,13 +25,6 @@ #include <system/audio.h> // ---------------------------------------------------------------------------- // the sim build doesn't have gettid #ifndef HAVE_GETTID # define gettid getpid #endif // ---------------------------------------------------------------------------- namespace android { Loading media/libmedia/IMediaMetadataRetriever.cpp +3 −23 Original line number Diff line number Diff line Loading @@ -30,26 +30,6 @@ // foreground thread. #ifndef DISABLE_GROUP_SCHEDULE_HACK /* desktop Linux needs a little help with gettid() */ #if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS) #define __KERNEL__ # include <linux/unistd.h> #ifdef _syscall0 _syscall0(pid_t,gettid) #else pid_t gettid() { return syscall(__NR_gettid);} #endif #undef __KERNEL__ #endif static int myTid() { #ifdef HAVE_GETTID return gettid(); #else return getpid(); #endif } #undef LOG_TAG #define LOG_TAG "IMediaMetadataRetriever" #include <utils/Log.h> Loading @@ -60,18 +40,18 @@ namespace android { static void sendSchedPolicy(Parcel& data) { SchedPolicy policy; get_sched_policy(myTid(), &policy); get_sched_policy(gettid(), &policy); data.writeInt32(policy); } static void setSchedPolicy(const Parcel& data) { SchedPolicy policy = (SchedPolicy) data.readInt32(); set_sched_policy(myTid(), policy); set_sched_policy(gettid(), policy); } static void restoreSchedPolicy() { set_sched_policy(myTid(), SP_FOREGROUND); set_sched_policy(gettid(), SP_FOREGROUND); } }; // end namespace android #endif Loading media/libmedia/JetPlayer.cpp +1 −8 Original line number Diff line number Diff line Loading @@ -23,13 +23,6 @@ #include <media/JetPlayer.h> #ifdef HAVE_GETTID static pid_t myTid() { return gettid(); } #else static pid_t myTid() { return getpid(); } #endif namespace android { Loading Loading @@ -188,7 +181,7 @@ int JetPlayer::render() { // signal main thread that we started { Mutex::Autolock l(mMutex); mTid = myTid(); mTid = gettid(); LOGV("JetPlayer::render(): render thread(%d) signal", mTid); mCondition.signal(); } Loading media/libmediaplayerservice/MediaPlayerService.cpp +3 −23 Original line number Diff line number Diff line Loading @@ -68,18 +68,6 @@ #include <OMX.h> /* desktop Linux needs a little help with gettid() */ #if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS) #define __KERNEL__ # include <linux/unistd.h> #ifdef _syscall0 _syscall0(pid_t,gettid) #else pid_t gettid() { return syscall(__NR_gettid);} #endif #undef __KERNEL__ #endif namespace { using android::media::Metadata; using android::status_t; Loading Loading @@ -387,14 +375,6 @@ status_t MediaPlayerService::Client::dump(int fd, const Vector<String16>& args) return NO_ERROR; } static int myTid() { #ifdef HAVE_GETTID return gettid(); #else return getpid(); #endif } status_t MediaPlayerService::dump(int fd, const Vector<String16>& args) { const size_t SIZE = 256; Loading Loading @@ -426,7 +406,7 @@ status_t MediaPlayerService::dump(int fd, const Vector<String16>& args) } result.append(" Files opened and/or mapped:\n"); snprintf(buffer, SIZE, "/proc/%d/maps", myTid()); snprintf(buffer, SIZE, "/proc/%d/maps", gettid()); FILE *f = fopen(buffer, "r"); if (f) { while (!feof(f)) { Loading @@ -446,13 +426,13 @@ status_t MediaPlayerService::dump(int fd, const Vector<String16>& args) result.append("\n"); } snprintf(buffer, SIZE, "/proc/%d/fd", myTid()); snprintf(buffer, SIZE, "/proc/%d/fd", gettid()); DIR *d = opendir(buffer); if (d) { struct dirent *ent; while((ent = readdir(d)) != NULL) { if (strcmp(ent->d_name,".") && strcmp(ent->d_name,"..")) { snprintf(buffer, SIZE, "/proc/%d/fd/%s", myTid(), ent->d_name); snprintf(buffer, SIZE, "/proc/%d/fd/%s", gettid(), ent->d_name); struct stat s; if (lstat(buffer, &s) == 0) { if ((s.st_mode & S_IFMT) == S_IFLNK) { Loading Loading
core/jni/android_util_Process.cpp +1 −12 Original line number Diff line number Diff line Loading @@ -38,18 +38,7 @@ #include <grp.h> #include <pwd.h> #include <signal.h> /* desktop Linux needs a little help with gettid() */ #if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS) #define __KERNEL__ # include <linux/unistd.h> #ifdef _syscall0 _syscall0(pid_t,gettid) #else pid_t gettid() { return syscall(__NR_gettid);} #endif #undef __KERNEL__ #endif #include <unistd.h> #define POLICY_DEBUG 0 #define GUARD_THREAD_PRIORITY 0 Loading
media/libmedia/AudioSystem.cpp +0 −7 Original line number Diff line number Diff line Loading @@ -25,13 +25,6 @@ #include <system/audio.h> // ---------------------------------------------------------------------------- // the sim build doesn't have gettid #ifndef HAVE_GETTID # define gettid getpid #endif // ---------------------------------------------------------------------------- namespace android { Loading
media/libmedia/IMediaMetadataRetriever.cpp +3 −23 Original line number Diff line number Diff line Loading @@ -30,26 +30,6 @@ // foreground thread. #ifndef DISABLE_GROUP_SCHEDULE_HACK /* desktop Linux needs a little help with gettid() */ #if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS) #define __KERNEL__ # include <linux/unistd.h> #ifdef _syscall0 _syscall0(pid_t,gettid) #else pid_t gettid() { return syscall(__NR_gettid);} #endif #undef __KERNEL__ #endif static int myTid() { #ifdef HAVE_GETTID return gettid(); #else return getpid(); #endif } #undef LOG_TAG #define LOG_TAG "IMediaMetadataRetriever" #include <utils/Log.h> Loading @@ -60,18 +40,18 @@ namespace android { static void sendSchedPolicy(Parcel& data) { SchedPolicy policy; get_sched_policy(myTid(), &policy); get_sched_policy(gettid(), &policy); data.writeInt32(policy); } static void setSchedPolicy(const Parcel& data) { SchedPolicy policy = (SchedPolicy) data.readInt32(); set_sched_policy(myTid(), policy); set_sched_policy(gettid(), policy); } static void restoreSchedPolicy() { set_sched_policy(myTid(), SP_FOREGROUND); set_sched_policy(gettid(), SP_FOREGROUND); } }; // end namespace android #endif Loading
media/libmedia/JetPlayer.cpp +1 −8 Original line number Diff line number Diff line Loading @@ -23,13 +23,6 @@ #include <media/JetPlayer.h> #ifdef HAVE_GETTID static pid_t myTid() { return gettid(); } #else static pid_t myTid() { return getpid(); } #endif namespace android { Loading Loading @@ -188,7 +181,7 @@ int JetPlayer::render() { // signal main thread that we started { Mutex::Autolock l(mMutex); mTid = myTid(); mTid = gettid(); LOGV("JetPlayer::render(): render thread(%d) signal", mTid); mCondition.signal(); } Loading
media/libmediaplayerservice/MediaPlayerService.cpp +3 −23 Original line number Diff line number Diff line Loading @@ -68,18 +68,6 @@ #include <OMX.h> /* desktop Linux needs a little help with gettid() */ #if defined(HAVE_GETTID) && !defined(HAVE_ANDROID_OS) #define __KERNEL__ # include <linux/unistd.h> #ifdef _syscall0 _syscall0(pid_t,gettid) #else pid_t gettid() { return syscall(__NR_gettid);} #endif #undef __KERNEL__ #endif namespace { using android::media::Metadata; using android::status_t; Loading Loading @@ -387,14 +375,6 @@ status_t MediaPlayerService::Client::dump(int fd, const Vector<String16>& args) return NO_ERROR; } static int myTid() { #ifdef HAVE_GETTID return gettid(); #else return getpid(); #endif } status_t MediaPlayerService::dump(int fd, const Vector<String16>& args) { const size_t SIZE = 256; Loading Loading @@ -426,7 +406,7 @@ status_t MediaPlayerService::dump(int fd, const Vector<String16>& args) } result.append(" Files opened and/or mapped:\n"); snprintf(buffer, SIZE, "/proc/%d/maps", myTid()); snprintf(buffer, SIZE, "/proc/%d/maps", gettid()); FILE *f = fopen(buffer, "r"); if (f) { while (!feof(f)) { Loading @@ -446,13 +426,13 @@ status_t MediaPlayerService::dump(int fd, const Vector<String16>& args) result.append("\n"); } snprintf(buffer, SIZE, "/proc/%d/fd", myTid()); snprintf(buffer, SIZE, "/proc/%d/fd", gettid()); DIR *d = opendir(buffer); if (d) { struct dirent *ent; while((ent = readdir(d)) != NULL) { if (strcmp(ent->d_name,".") && strcmp(ent->d_name,"..")) { snprintf(buffer, SIZE, "/proc/%d/fd/%s", myTid(), ent->d_name); snprintf(buffer, SIZE, "/proc/%d/fd/%s", gettid(), ent->d_name); struct stat s; if (lstat(buffer, &s) == 0) { if ((s.st_mode & S_IFMT) == S_IFLNK) { Loading