summaryrefslogtreecommitdiffstats
path: root/libc/include
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-09-22 12:40:22 -0700
committerDavid 'Digit' Turner <digit@google.com>2009-09-22 15:17:50 -0700
commit3f56b7f65adb9ee35cd0f878ca00b92011eec427 (patch)
tree94c29385b9f2afa873c61ddad29b12f7e9b8432a /libc/include
parent916edf2a3fc60e08a5f29cd322d9f2a04d15cb49 (diff)
downloadbionic-3f56b7f65adb9ee35cd0f878ca00b92011eec427.zip
bionic-3f56b7f65adb9ee35cd0f878ca00b92011eec427.tar.gz
bionic-3f56b7f65adb9ee35cd0f878ca00b92011eec427.tar.bz2
Add pthread_mutex_lock_timeout_np
This is used to perform a mutex lock for a given amount of milliseconds before giving up. Using the _np prefix since this is absolutely not portable. Also remove a compiler warning in pthread_attr_getstackaddr
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/pthread.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index ae7b758..6603b3f 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -207,6 +207,13 @@ int pthread_cond_timeout_np(pthread_cond_t *cond,
pthread_mutex_t * mutex,
unsigned msecs);
+/* same as pthread_mutex_lock(), but will wait up to 'msecs' milli-seconds
+ * before returning. same return values than pthread_mutex_trylock though, i.e.
+ * returns EBUSY if the lock could not be acquired after the timeout
+ * expired.
+ */
+int pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs);
+
int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *));
int pthread_key_delete (pthread_key_t);
int pthread_setspecific(pthread_key_t key, const void *value);