Go to file
David 'Digit' Turner 022d303116 libc: optimize pthread mutex lock/unlock operations (1/2)
This patch provides several small optimizations to the
implementation of mutex locking and unlocking. Note that
a following patch will get rid of the global recursion
lock, and provide a few more aggressive changes, I
though it'd be simpler to split this change in two parts.

+ New behaviour: pthread_mutex_lock et al now detect
  recursive mutex overflows and will return EAGAIN in
  this case, as suggested by POSIX. Before, the counter
  would just wrap to 0.

- Remove un-necessary reloads of the mutex value from memory
  by storing it in a local variable (mvalue)

- Remove un-necessary reload of the mutex value by passing
  the 'shared' local variable to _normal_lock / _normal_unlock

- Remove un-necessary reload of the mutex value by using a
  new macro (MUTEX_VALUE_OWNER()) to compare the thread id
  for recursive/errorcheck mutexes

- Use a common inlined function to increment the counter
  of a recursive mutex. Also do not use the global
  recursion lock in this case to speed it up.

Change-Id: I106934ec3a8718f8f852ef547f3f0e9d9435c816
2011-12-07 22:09:48 +01:00
libc libc: optimize pthread mutex lock/unlock operations (1/2) 2011-12-07 22:09:48 +01:00
libdl fix prototype of dladdr 2011-09-28 12:17:34 -07:00
libm am 32ca348e: am ce0d646c: resolved conflicts for merge of 6cda7b62 to gingerbread-plus-aosp 2011-09-29 21:09:08 -07:00
libstdc++ bionic: Do not use <sys/atomics.h> for platform code. 2011-11-16 16:28:10 +01:00
libthread_db bionic, libthread_db x86 fixes 2011-04-27 09:12:58 -07:00
linker get rid of unused "main" function. 2011-12-05 16:09:30 -08:00
.gitignore Merge memory checking functionality from sandbox 2010-02-16 11:43:18 -08:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:11:41 -07:00
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:04:02 -08:00
MAINTAINERS added and modified libm to support SuperH architecture 2009-08-31 16:25:42 +09:00
ThirdPartyProject.prop add meta-files about 3rd party projects 2010-07-16 11:41:33 -07:00