aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/_umtx.h
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2012-02-25 02:12:17 +0000
committerDavid Xu <davidxu@FreeBSD.org>2012-02-25 02:12:17 +0000
commitdf1f1bae9eac5f3f838c8939e4de2c5458aba001 (patch)
tree5f0ee0973e89656c6bff9bc1ab050eff9e1ee496 /sys/sys/_umtx.h
parentaa10345311f71942189d0c203095172bc6c809cb (diff)
downloadsrc-df1f1bae9eac5f3f838c8939e4de2c5458aba001.tar.gz
src-df1f1bae9eac5f3f838c8939e4de2c5458aba001.zip
In revision 231989, we pass a 16-bit clock ID into kernel, however
according to POSIX document, the clock ID may be dynamically allocated, it unlikely will be in 64K forever. To make it future compatible, we pack all timeout information into a new structure called _umtx_time, and use fourth argument as a size indication, a zero means it is old code using timespec as timeout value, but the new structure also includes flags and a clock ID, so the size argument is different than before, and it is non-zero. With this change, it is possible that a thread can sleep on any supported clock, though current kernel code does not have such a POSIX clock driver system.
Notes
Notes: svn path=/head/; revision=232144
Diffstat (limited to 'sys/sys/_umtx.h')
-rw-r--r--sys/sys/_umtx.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/_umtx.h b/sys/sys/_umtx.h
index fa0ed99280b7..20a651064076 100644
--- a/sys/sys/_umtx.h
+++ b/sys/sys/_umtx.h
@@ -31,6 +31,7 @@
#define _SYS__UMTX_H_
#include <sys/_types.h>
+#include <sys/_timespec.h>
struct umtx {
volatile unsigned long u_owner; /* Owner of the mutex. */
@@ -64,4 +65,10 @@ struct _usem {
__uint32_t _flags;
};
+struct _umtx_time {
+ struct timespec _timeout;
+ __uint32_t _flags;
+ __uint32_t _clockid;
+};
+
#endif /* !_SYS__UMTX_H_ */