thread-r0drv-freebsd.c revision 445a156b9ab321242ed8ad2ee143626c05865acf
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * IPRT - Threads (Part 1), Ring-0 Driver, FreeBSD.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright (c) 2007 knut st. osmundsen <bird-src-spam@anduin.net>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Permission is hereby granted, free of charge, to any person
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * obtaining a copy of this software and associated documentation
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * files (the "Software"), to deal in the Software without
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * restriction, including without limitation the rights to use,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * copy, modify, merge, publish, distribute, sublicense, and/or sell
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * copies of the Software, and to permit persons to whom the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Software is furnished to do so, subject to the following
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * conditions:
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The above copyright notice and this permission notice shall be
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * included in all copies or substantial portions of the Software.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * OTHER DEALINGS IN THE SOFTWARE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*******************************************************************************
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* Header Files *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync*******************************************************************************/
5a3672dca0301427a400aec8734acd70e2cf24a4vboxsync * 0 ms sleep -> yield.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Translate milliseconds into ticks and go to sleep.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync int64_t cTicks64 = ((uint64_t)cMillies * hz) / 1000;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync return false; /** @todo figure this one ... */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTDECL(bool) RTThreadPreemptIsPending(RTTHREAD hThread)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync /* yes, RTThreadPreemptIsPending is reliable. */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync return true;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState)