summaryrefslogtreecommitdiffstats
path: root/include/binder
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-12-07 17:59:37 -0800
committerDianne Hackborn <hackbod@google.com>2009-12-07 19:11:14 -0800
commit8c6cedc9bc9a4b69616a79a95449f6f6b08c7bf1 (patch)
treeb1bbc3748af558bc7a56d7ac4fb96ca059cc845b /include/binder
parentd56352bddd717d2e45f1f3ee7fb52ef7f593f950 (diff)
downloadframeworks_native-8c6cedc9bc9a4b69616a79a95449f6f6b08c7bf1.zip
frameworks_native-8c6cedc9bc9a4b69616a79a95449f6f6b08c7bf1.tar.gz
frameworks_native-8c6cedc9bc9a4b69616a79a95449f6f6b08c7bf1.tar.bz2
Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling thread is at a background priority (the driver will have taken care of propagating this from the calling thread), then stick it in to the background scheduling group. Plus an API to turn this off for the process, which is used by the system process. This also pulls some of the code for managing scheduling classes out of the Process JNI wrappers and in to some convenience methods in thread.h.
Diffstat (limited to 'include/binder')
-rw-r--r--include/binder/IBinder.h2
-rw-r--r--include/binder/IPCThreadState.h10
2 files changed, 10 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;