pthread: Implement pthread_timedjoin_np.

This also corrects an oversight in pthread_join() that not all
potential error codes of wait_for_thread were accounted for
(in particular EDEADLK wasn't.)

This is a non-standard extension, but is present on both Linux
and FreeBSD, at least.

Change-Id: Ie96e7a261e863ab491bee30349360df7ff3d0e80
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5099
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2024-07-16 19:59:39 +00:00
committed by waddlesplash
parent 69b420563b
commit 9a4c543934
2 changed files with 48 additions and 16 deletions
+2
View File
@@ -25,6 +25,8 @@ extern int pthread_getattr_np(pthread_t thread, pthread_attr_t* attr);
extern int pthread_getname_np(pthread_t thread, char* buffer, size_t length);
extern int pthread_setname_np(pthread_t thread, const char* name);
extern int pthread_timedjoin_np(pthread_t thread, void** _value, const struct timespec* abstime);
extern int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, const cpuset_t* mask);
extern int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize, cpuset_t* mask);