2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1997-2009 Oracle. All rights reserved.
15 * Yield the processor, optionally pausing until running again.
18 __os_yield(env, secs, usecs)
20 u_long secs, usecs; /* Seconds and microseconds. */
28 /* Don't require the values be normalized. */
29 for (; usecs >= US_PER_SEC; usecs -= US_PER_SEC)
33 * Yield the processor so other processes or threads can run.
35 * Sheer raving paranoia -- don't sleep for 0 time, in case some
36 * implementation doesn't yield the processor in that case.
38 MSLEEP(secs * MS_PER_SEC + (usecs / US_PER_MS) + 1);