History log of /system/core/include/utils/threads.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2bd99599bb9eef197e6d1ccacb9f808ebfbcc598 26-Feb-2012 Mathias Agopian <mathias@google.com> split utils/threads.h into multiple headers

AndroidDefs.h - C/C++ enums and types
Mutex.h - Mutex class declaration
Condition.h - Condition class declaration
RWLock.h - RWLock class declaration
Thread.h - Thread class declaration
AndroidThreads.h - low-level thread creation functions
threads.h - includes all the above for backward source compatibility

Change-Id: Ia2f80c175333b59a41d1720985810bb2346e94cb
Note: implementations are still in Threads.cpp
/system/core/include/utils/threads.h
d731f07cc9ca7e8fc327c7910de7bea7e22c2fd3 12-Jul-2011 Glenn Kasten <gkasten@google.com> Thread::getTid returns pid_t gettid() after run

This is needed when the parent or any other thread besides the child
needs access to the child's kernel tid.

Change-Id: Ib148505913eb78314cfd76657c30d7b20663dffd
/system/core/include/utils/threads.h
8ddbed9efdd879cee3553d7be2f534dc76c191d2 15-Sep-2011 Andreas Huber <andih@google.com> A new API "androidGetThreadPriority"

Change-Id: I6baeead8c70460863343fd557250635fb1e6a170
/system/core/include/utils/threads.h
c3a5225d4ec0e98ca671ada8cba17878c656e3d5 10-Aug-2011 Mathias Agopian <mathias@google.com> Fix typos and use new HAL_PRIORITY_URGENT_DISPLAY constant

Change-Id: I703f8a96dd0dfec427e74363ad95729bfefc95c7
/system/core/include/utils/threads.h
6fbe0a86a8bb9da0ff879c3d237c2637eb0d5a8d 23-Jun-2011 Glenn Kasten <gkasten@google.com> Add C++ thread API androidGetThreadSchedulingGroup

This API is intended for applications that need to read a thread's
scheduling group, while using the higher-level (C++) family of thread APIs.

Change-Id: I5e58017f74c3989b20b5b1cc2bc4483c95720520
/system/core/include/utils/threads.h
6839e8e9ee894191e3fa857859311337357fe191 23-Jun-2011 Glenn Kasten <gkasten@google.com> Add Thread::join

This new API will be used by applications that previously used the
lower-level pthread APIs (including pthread_join). Centralizing on the
Thread class instead of pthread will permit additional functionality to
be added later in only one location.

Change-Id: I8460169ac9c61ac9f85752405ed54c94651058d7
/system/core/include/utils/threads.h
5e0243f4d6313419fdc3affc205b790a2a965208 23-Jun-2011 Glenn Kasten <gkasten@google.com> Thread ID zero for androidSetThreadSchedulingGroup

Already implemented by androidSetThreadPriority but not documented

Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
/system/core/include/utils/threads.h
a538e268e653d8fa1ea27659f507bc0ce5ceead0 02-Jun-2011 Glenn Kasten <gkasten@google.com> Remove redundant memory barrier

pthread_create already includes the necessary memory barriers:
- parent at pthread_create : pthread_mutex_unlock(start_mutex)
- child at __thread_entry : pthread_mutex_lock(start_mutex)

Add lock around uses of mThread.

Added comments:
- uses of mThread require lock
- androidCreateRawThreadEtc returned ID is not safe for direct use from non-parent threads.

Change-Id: I18cb296b41ddaf64cf127b57aab31154319b5970
/system/core/include/utils/threads.h
966a48f3e78e75c3a4f3a2f23b98e970f06bf983 01-Feb-2011 Glenn Kasten <gkasten@google.com> Bug 3362814 Fix SMP race in access to mRequestExit

Also fix an unlikely SMP race in access to mHoldSelf on entry to _threadLoop.

Change-Id: I6cbc0b94739c7dd5e77e8a5ba0da22cdc0b1a4db
/system/core/include/utils/threads.h
9b0be73f2aca790774e7a85f5653afe33947c8ed 20-May-2010 Mathias Agopian <mathias@google.com> added RWLock C++ wrapper

Change-Id: Ia736bf7f6e2c49915a9ab5669551cf89dafa7961
/system/core/include/utils/threads.h
68f64818203cf7d2ef1b4707448191829221898e 20-Mar-2010 Mathias Agopian <mathias@google.com> libutils Condition are now PRIVATE by default

Condition must be initialized with SHARED for the old behavior, where
they can be used accross processes.

Updated the two places android that require SHARED conditions.

PRIVATE conditions (and mutexes) use more efficient syscalls.

Change-Id: I9a281a4b88206e92ac559c66554e886b9c62db3a
/system/core/include/utils/threads.h
235af97debd4b75263dfdb9e3be78e50eff2a53a 08-Dec-2009 Dianne Hackborn <hackbod@google.com> 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.
/system/core/include/utils/threads.h
f4d57661befb874bff67d20f39ed737dbea62c67 12-Sep-2009 San Mehat <san@google.com> process: Switch to common cutils sched_policy api

Signed-off-by: San Mehat <san@google.com>
/system/core/include/utils/threads.h
7089ab8b38b626c79a55fdf216e07ec0c8088d01 09-Sep-2009 San Mehat <san@google.com> Process: Add support for using scheduler policies instead of cgroups.
Preference is given to cgroups if available.

Signed-off-by: San Mehat <san@google.com>
/system/core/include/utils/threads.h
51ce3ad7607a4b5ac533e6a3fd90709b30dba03f 09-Sep-2009 Mathias Agopian <mathias@google.com> use broadcast() instead of signal() when signaling the condition-variable Thread::RequestExitAndWait() is waiting for

we could have several thread waiting on the condition and they all need to wake-up.
also added a debug "mTid" field in the class, which contains the tid of the thread (as opposed to pthread_t), this
is useful when debugging under gdb for instance.
/system/core/include/utils/threads.h
de6926bc94a2e73fc2b5364840deebc6f2ff7f6e 14-Jul-2009 Mathias Agopian <mathias@google.com> add a ctor to Mutex to specify the type, which can be shared. This is used by sf and af an soon will allow some optimization in the kernel for non shared mutexes
/system/core/include/utils/threads.h
1555436473afd296488235f0aa22bb17162a929f 13-Jul-2009 Mathias Agopian <mathias@google.com> implement Mutex and Condition with pthread instead of calling futex directly.

internally pthread uses futex. the implementation consists of simple inlines
there are no implementation files anymore.
/system/core/include/utils/threads.h
d0ef3d46f90b030b4b6d1a667e99ba92d7cf84bd 23-May-2009 Mathias Agopian <mathias@google.com> some work to try to reduce the code size of some native libraries

- make sure that all binder Bn classes define a ctor and dtor in their respective library.
This avoids duplication of the ctor/dtor in libraries where these objects are instantiated.
This is also cleaner, should we want these ctor/dtor to do something one day.

- same change as above for some Bp classes and various other non-binder classes

- moved the definition of CHECK_INTERFACE() in IInterface.h instead of having it everywhere.

- improved the CHECK_INTERFACE() macro so it calls a single method in Parcel, instead of inlining its code everywhere

- IBinder::getInterfaceDescriptor() now returns a "const String16&" instead of String16, which saves calls to String16 and ~String16

- implemented a cache for BpBinder::getInterfaceDescriptor(), since this does an IPC. HOWEVER, this method never seems to be called.
The cache makes BpBinder bigger, so we need to figure out if we need this method at all.
/system/core/include/utils/threads.h
624a35ee485df833765d4367e10975921a92c16e 21-Apr-2009 San Mehat <san@google.com> Add support for changing a threads scheduler group. Three groups are available (default, background non interactive, foreground boost). Setting a thread priority to PRIORITY_BACKGROUND will transparently change groups to background

Signed-off-by: San Mehat <san@google.com>
/system/core/include/utils/threads.h
7a4c83922e551506fdc6c5fbca6d107ebdeef867 05-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@136594
/system/core/include/utils/threads.h
cbb1011c95e0c25c29e40e203a6a31bccd029da3 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/include/utils/threads.h
cf59fa8dc7ddca5a172860223b06afed5d4ec0e0 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/system/core/include/utils/threads.h
d245d1d09731d6a19e8a25559d3907f54441ac3d 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/system/core/include/utils/threads.h