summaryrefslogtreecommitdiffstats
path: root/sys/sys/_umtx.h
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2012-02-25 02:12:17 +0000
committerdavidxu <davidxu@FreeBSD.org>2012-02-25 02:12:17 +0000
commit61033245ae03eb18451a20806786ac41f6bad7ee (patch)
tree5f0ee0973e89656c6bff9bc1ab050eff9e1ee496 /sys/sys/_umtx.h
parent1754fd0691ea56d59cc2527d2867e5b0f681e569 (diff)
downloadFreeBSD-src-61033245ae03eb18451a20806786ac41f6bad7ee.zip
FreeBSD-src-61033245ae03eb18451a20806786ac41f6bad7ee.tar.gz
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.
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 fa0ed99..20a6510 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_ */
OpenPOWER on IntegriCloud