summaryrefslogtreecommitdiff
path: root/libs/utils/Threads.cpp
AgeCommit message (Collapse)Author
2012-03-07remove files that moved to frameworks/native Mathias Agopian
Change-Id: I140d291e520097b1148930f736823650e08488f7
2012-01-17Thread::getTid returns pid_t gettid() after run Glenn Kasten
This is needed when the parent or any other thread besides the child needs access to the child's kernel tid. Change-Id: Ib148505913eb78314cfd76657c30d7b20663dffd
2012-01-08Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-06Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/157065 Bug: 5449033 Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
2011-10-25Rename (IF_)LOG() to (IF_)ALOG() DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/#/c/141576 Bug: 5449033 Change-Id: I42575e7c29cf1c0f465c357a5c97ab118df6f473
2011-09-16Fix androidGetThreadPriority for non-pthread configurations. Andreas Huber
related-to-build Change-Id: Ic865af0865906f96fd615a56a030c8e3adaf13c4
2011-09-16A new API "androidGetThreadPriority" Andreas Huber
Change-Id: I6baeead8c70460863343fd557250635fb1e6a170
2011-08-29Merge "Add C++ thread API androidGetThreadSchedulingGroup" Glenn Kasten
2011-07-14Add a call to pthread_attr_destroy to avoid potential memory leaks. Le-Chun Wu
Change-Id: Ib57efc3530e9793298190cc9cab19c9af54e11a7
2011-07-08Add C++ thread API androidGetThreadSchedulingGroup Glenn Kasten
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
2011-07-06Merge "Add Thread::join" Glenn Kasten
2011-06-23Add Thread::join Glenn Kasten
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
2011-06-22Thread ID zero for androidSetThreadSchedulingGroup Glenn Kasten
Already implemented by androidSetThreadPriority but not documented Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
2011-06-14Merge "Bug 4608375" Glenn Kasten
2011-06-14Bug 4608375 Glenn Kasten
Update priority and policy together for audio threads Change-Id: Ib3b07b32586c222c4aacbf23414ae8b05db502be
2011-06-10Remove redundant memory barrier Glenn Kasten
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
2011-02-23Bug 3362814 Fix SMP race in access to mRequestExit Glenn Kasten
Also fix an unlikely SMP race in access to mHoldSelf on entry to _threadLoop. Change-Id: I6cbc0b94739c7dd5e77e8a5ba0da22cdc0b1a4db
2011-02-16Clean up use of HAVE_ANDROID_OS Kenny Root
HAVE_ANDROID_OS was defined as "1" for targets, but never defined as "0" for non-targets. Changing them to #ifdef should be safe and matches all the other uses of HAVE_ANDROID_OS throughout the system. Change-Id: I82257325a8ae5e4e4371ddfc4dbf51cea8ea0abb
2011-01-30Merge from open-source gingerbread Jean-Baptiste Queru
Change-Id: I56f2ed37187796807fbf0de15274a85164f9432c
2011-01-25fix failing thread object run Ritu Srivastava
A previously exited Thread object refuses to run again, if the thread-id of the caller, conincides with the thread-id it previously used in the worker thread. Hence reset the previously used worker thread-id to -1 when it exits. Signed-off-by: Ritu Srivastava <rsrivast@sta.samsung.com> Change-Id: I873925c312a43ec8a16392b98cc959042ff6bfd2 Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
2011-01-04Fix issue 3302649. Eric Laurent
The cause of the problem is that AudioTrack::start() can fail if it is called from a newly created thread that has the same ID as the AudioTrack callback thread that has just been stopped and not yet exited. This is possible as the thread ID used by the Thread class is not the TID. The fix consists in clearing the thread ID before exiting the thread loop. Change-Id: I66e679665c384403cb3ba2c31746f5de72d5836d
2010-09-09Always set the scheduling group when starting a new thread. Dianne Hackborn
Change-Id: Ia33acf13fc3752707f3819928c36315e223fa1bd
2010-09-07Hopefully fix the build. Dianne Hackborn
Change-Id: Id8cd92c0895c9939e1386ef488bd1309a3be3568
2010-09-07Add system property to turn off scheduling groups. Dianne Hackborn
Do this: adb shell setprop debug.sys.noschedgroups 1 Change-Id: I6e06a74205fd45ee1526ce71fe33944465d39984
2009-12-08Maybe really fix windows build. Dianne Hackborn
2009-12-08Hopefully fix Windows build Dianne Hackborn
2009-12-07Propagate background scheduling class across processes. Dianne Hackborn
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.
2009-09-09use broadcast() instead of signal() when signaling the condition-variable ↵ Mathias Agopian
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.
2009-08-01Fix Win32 libutils to get a working SDK build. David 'Digit' Turner
2009-07-13implement Mutex and Condition with pthread instead of calling futex directly. Mathias Agopian
internally pthread uses futex. the implementation consists of simple inlines there are no implementation files anymore.
2009-03-05auto import from //depot/cupcake/@136594 The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@135843 The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@135843 The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@132589 The Android Open Source Project
2009-03-02auto import from //depot/cupcake/@137055 The Android Open Source Project
2008-10-21Initial Contribution The Android Open Source Project