Commit Graph

14 Commits

Author SHA1 Message Date
Mathias Agopian
dcf01e6644 added RWLock C++ wrapper
Change-Id: Ia736bf7f6e2c49915a9ab5669551cf89dafa7961
2010-05-19 15:12:59 -07:00
Mathias Agopian
26d244281a 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
2010-03-19 16:16:43 -07:00
Dianne Hackborn
8c6cedc9bc 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.
2009-12-07 19:11:14 -08:00
San Mehat
c101e04abb process: Switch to common cutils sched_policy api
Signed-off-by: San Mehat <san@google.com>
2009-09-12 10:48:03 -07:00
San Mehat
9410f98e78 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>
2009-09-10 15:09:38 -07:00
Mathias Agopian
4de4ebf6a2 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.
2009-09-09 02:45:26 -07:00
Mathias Agopian
eb9fd685f8 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 2009-07-13 22:06:36 -07:00
Mathias Agopian
ec0f1f6720 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.
2009-07-13 15:14:23 -07:00
Mathias Agopian
83c0446f27 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.
2009-05-26 16:12:20 -07:00
San Mehat
046cda49f9 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>
2009-04-27 09:17:06 -07:00
The Android Open Source Project
9adf84a4b6 auto import from //depot/cupcake/@136594 2009-03-05 14:34:35 -08:00
The Android Open Source Project
edbf3b6af7 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d5193d9394 auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
7c1b96a165 Initial Contribution 2008-10-21 07:00:00 -07:00