tstRTProcWait.cpp revision ababd7e83ee3d23c5191a0d3802f10764df69e36
/* $Id$ */
/** @file
* innotek Portable Runtime Testcase - RTProcWait.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <iprt/semaphore.h>
typedef struct SpawnerArgs
{
const char *pszExe;
} SPAWNERARGS, *PSPAWNERARGS;
{
}
{
RTR3Init();
return 42;
RTPrintf("tstRTWait: spawning a child in a separate thread and waits for it in the main thread...\n");
int rc = RTThreadCreate(&Thread, SpawnerThread, &Args, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "SPAWNER");
if (RT_SUCCESS(rc))
{
/* Wait for it to complete. */
int rc2;
if (RT_SUCCESS(rc))
if (RT_SUCCESS(rc))
{
/* wait for the process to complete */
if (RT_SUCCESS(rc))
{
RTPrintf("tstRTWait: Success!\n");
else
{
else
}
}
else
}
else
}
else
}