summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-12-08 19:45:59 -0800
committerDianne Hackborn <hackbod@google.com>2009-12-08 19:45:59 -0800
commitd0aeccebe2d1539a9f0b5f19beb6c272a60d3cc6 (patch)
tree350426e8aee428f9637dfca0f5954a9136f56723 /libs/utils
parent80240139e39795c1176cf0ab7ab32986aa681422 (diff)
downloadframeworks_native-d0aeccebe2d1539a9f0b5f19beb6c272a60d3cc6.zip
frameworks_native-d0aeccebe2d1539a9f0b5f19beb6c272a60d3cc6.tar.gz
frameworks_native-d0aeccebe2d1539a9f0b5f19beb6c272a60d3cc6.tar.bz2
Maybe really fix windows build.
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/Threads.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 00f9943..2b1f490 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -286,10 +286,12 @@ int androidSetThreadSchedulingGroup(pid_t tid, int grp)
return BAD_VALUE;
}
+#if defined(HAVE_PTHREADS)
if (set_sched_policy(tid, (grp == ANDROID_TGROUP_BG_NONINTERACT) ?
SP_BACKGROUND : SP_FOREGROUND)) {
return PERMISSION_DENIED;
}
+#endif
return NO_ERROR;
}
@@ -297,6 +299,8 @@ int androidSetThreadSchedulingGroup(pid_t tid, int grp)
int androidSetThreadPriority(pid_t tid, int pri)
{
int rc = 0;
+
+#if defined(HAVE_PTHREADS)
int lasterr = 0;
if (pri >= ANDROID_PRIORITY_BACKGROUND) {
@@ -309,7 +313,6 @@ int androidSetThreadPriority(pid_t tid, int pri)
lasterr = errno;
}
-#if defined(HAVE_PTHREADS)
if (setpriority(PRIO_PROCESS, tid, pri) < 0) {
rc = INVALID_OPERATION;
} else {