On Wed, Feb 22, 2012 at 03:22:50AM +0000, David Xu wrote:
> Author: davidxu
> Date: Wed Feb 22 03:22:49 2012
> New Revision: 231989
> URL: http://svn.freebsd.org/changeset/base/231989

> Log:
>   Use unused fourth argument of umtx_op to pass flags to kernel for operation
>   UMTX_OP_WAIT. Upper 16bits is enough to hold a clock id, and lower
>   16bits is used to pass flags. The change saves a clock_gettime() syscall
>   from libthr.

> Modified:
>   head/lib/libthr/thread/thr_umtx.c
>   head/sys/kern/kern_umtx.c
>   head/sys/sys/umtx.h
> 
> Modified: head/lib/libthr/thread/thr_umtx.c
> ==============================================================================
> --- head/lib/libthr/thread/thr_umtx.c Wed Feb 22 01:50:13 2012        
> (r231988)
> +++ head/lib/libthr/thread/thr_umtx.c Wed Feb 22 03:22:49 2012        
> (r231989)
> @@ -200,20 +200,10 @@ int
> +             abstime != NULL ? (void *)(uintptr_t)((clockid << 16) | 
> UMTX_WAIT_ABSTIME) : 0, 

Please check that this shift does not lose any information (i.e.,
clockid >= 0 && clockid <= 0xFFFF) before doing it.

Implementing clock_getcpuclockid() will require clockids greater than
65535 because such clockids contain a process id.

-- 
Jilles Tjoelker
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to