summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-12-09 15:49:02 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-09 15:49:02 -0800
commit68a3b8b66044d0a9fa901ad306fc6db6d13f94d3 (patch)
treedff67f3f793d42bb4da8f723afb904faa0101dff /include
parent9f1ea0d47f5aa18cf949593e6bfd36af9c6a55be (diff)
parent24eca800d4b34e7d13fbcbc1ab74c9d91ff6a4e1 (diff)
downloadframeworks_base-68a3b8b66044d0a9fa901ad306fc6db6d13f94d3.zip
frameworks_base-68a3b8b66044d0a9fa901ad306fc6db6d13f94d3.tar.gz
frameworks_base-68a3b8b66044d0a9fa901ad306fc6db6d13f94d3.tar.bz2
am 24eca800: Merge change I887f355f into eclair-mr2
Merge commit '24eca800d4b34e7d13fbcbc1ab74c9d91ff6a4e1' into eclair-mr2-plus-aosp * commit '24eca800d4b34e7d13fbcbc1ab74c9d91ff6a4e1': Propagate background scheduling class across processes.
Diffstat (limited to 'include')
-rw-r--r--include/binder/IBinder.h2
-rw-r--r--include/binder/IPCThreadState.h10
-rw-r--r--include/utils/threads.h18
3 files changed, 28 insertions, 2 deletions
diff --git a/include/binder/IBinder.h b/include/binder/IBinder.h
index 884b5c1..749a977 100644
--- a/include/binder/IBinder.h
+++ b/include/binder/IBinder.h
@@ -52,7 +52,7 @@ public:
DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'),
INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'),
- // Corresponds to tfOneWay -- an asynchronous call.
+ // Corresponds to TF_ONE_WAY -- an asynchronous call.
FLAG_ONEWAY = 0x00000001
};
diff --git a/include/binder/IPCThreadState.h b/include/binder/IPCThreadState.h
index 78306b2..3ab985d 100644
--- a/include/binder/IPCThreadState.h
+++ b/include/binder/IPCThreadState.h
@@ -68,6 +68,13 @@ public:
static void shutdown();
+ // Call this to disable switching threads to background scheduling when
+ // receiving incoming IPC calls. This is specifically here for the
+ // Android system process, since it expects to have background apps calling
+ // in to it but doesn't want to acquire locks in its services while in
+ // the background.
+ static void disableBackgroundScheduling(bool disable);
+
private:
IPCThreadState();
~IPCThreadState();
@@ -93,9 +100,10 @@ private:
void* cookie);
const sp<ProcessState> mProcess;
+ const pid_t mMyThreadId;
Vector<BBinder*> mPendingStrongDerefs;
Vector<RefBase::weakref_type*> mPendingWeakDerefs;
-
+
Parcel mIn;
Parcel mOut;
status_t mLastError;
diff --git a/include/utils/threads.h b/include/utils/threads.h
index 0fc533f..130d83c 100644
--- a/include/utils/threads.h
+++ b/include/utils/threads.h
@@ -124,6 +124,24 @@ typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction,
extern void androidSetCreateThreadFunc(android_create_thread_fn func);
+// ------------------------------------------------------------------
+// Extra functions working with raw pids.
+
+// Get pid for the current thread.
+extern pid_t androidGetTid();
+
+// Change the scheduling group of a particular thread. The group
+// should be one of the ANDROID_TGROUP constants. Returns BAD_VALUE if
+// grp is out of range, else another non-zero value with errno set if
+// the operation failed.
+extern int androidSetThreadSchedulingGroup(pid_t tid, int grp);
+
+// Change the priority AND scheduling group of a particular thread. The priority
+// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION
+// if the priority set failed, else another value if just the group set failed;
+// in either case errno is set.
+extern int androidSetThreadPriority(pid_t tid, int prio);
+
#ifdef __cplusplus
}
#endif