From df1f1bae9eac5f3f838c8939e4de2c5458aba001 Mon Sep 17 00:00:00 2001 From: David Xu Date: Sat, 25 Feb 2012 02:12:17 +0000 Subject: 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. --- sys/sys/_umtx.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/sys/_umtx.h') 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 +#include 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_ */ -- cgit v1.2.3