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
This commit is contained in:
David 'Digit' Turner
2009-09-22 12:40:22 -07:00
parent 916edf2a3f
commit 3f56b7f65a
2 changed files with 138 additions and 10 deletions

View File

@@ -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);