thread.cpp revision b72771e8c6ba3b3d9ebdd7977730325131ae0f98
/** @file
*
* VirtualBox additions client application: thread class.
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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 (GPL) 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include <iostream> /* For std::exception */
#include "thread.h"
/** Stop the thread using its stop method and get the exit value. */
{
int rc = VINF_SUCCESS;
LogFlowThisFunc(("\n"));
{
return VERR_INTERNAL_ERROR;
}
mExit = true;
if (0 != (mFlags & RTTHREADFLAGS_WAITABLE))
{
if (RT_SUCCESS(rc))
{
}
else
{
}
}
return rc;
}
/** Destroy the class, stopping the thread if necessary. */
VBoxGuestThread::~VBoxGuestThread(void)
{
LogFlowThisFunc(("\n"));
if (NIL_RTTHREAD != mSelf)
{
try
{
stop(2000, 0);
}
catch(...) {}
}
LogFlowThisFunc(("returning\n"));
}
/** Start the thread. */
int VBoxGuestThread::start(void)
{
int rc = VINF_SUCCESS;
LogFlowThisFunc(("returning\n"));
{
return VERR_INTERNAL_ERROR;
}
mExit = false;
return rc;
}
/** Yield the CPU */
bool VBoxGuestThread::yield(void)
{
return RTThreadYield();
}
/** The "real" thread function for the VBox runtime. */
{
int rc = VINF_SUCCESS;
LogFlowFunc(("\n"));
try
{
}
{
}
catch (...)
{
LogRelFunc(("Caught unknown exception in thread.\n"));
}
return rc;
}