3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * IPRT Testcase - RTThreadPoke.
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * Copyright (C) 2010 Oracle Corporation
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * available from http://www.virtualbox.org. This file is free software;
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * you can redistribute it and/or modify it under the terms of the GNU
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * General Public License (GPL) as published by the Free Software
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * The contents of this file may alternatively be used under the terms
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * of the Common Development and Distribution License Version 1.0
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * VirtualBox OSE distribution, in which case the provisions of the
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * CDDL are applicable instead of those of the GPL.
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * You may elect to license modified versions of this file under the
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync * terms and conditions of either the GPL or the CDDL or both.
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync/*******************************************************************************
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync* Header Files *
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync*******************************************************************************/
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync/*******************************************************************************
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync* Global Variables *
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync*******************************************************************************/
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsyncstatic DECLCALLBACK(int) test1Thread(RTTHREAD hSelf, void *pvUser)
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync RTTEST_CHECK_RC(g_hTest, RTThreadSleep(60*1000), VERR_INTERRUPTED);
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync RTTESTI_CHECK_RC_RETV(RTThreadCreate(&hThread, test1Thread, NULL, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "test1"),
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync RTThreadSleep(500); RTThreadSleep(1500); /* fudge */
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync RTTESTI_CHECK_RC(RTThreadPoke(hThread), VINF_SUCCESS);
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync RTTESTI_CHECK_RC(RTThreadWait(hThread, RT_INDEFINITE_WAIT, NULL), VINF_SUCCESS);
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync#endif /* !RT_OS_WINDOWS */
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync RTEXITCODE rcExit = RTTestInitAndCreate("tstRTThreadPoke", &g_hTest);
3c672b6b491561df7771b9a19012f3cd14fdb672vboxsync return RTTestSkipAndDestroy(g_hTest, "No RTThreadPoke on Windows");