serialized access to startImpl() functions

This commit is contained in:
Aleksandar Fabijanic
2008-04-11 09:27:41 +00:00
parent 89ca50a581
commit 01613f5cf6
2 changed files with 6 additions and 0 deletions

View File

@@ -83,6 +83,8 @@ void ThreadImpl::setPriorityImpl(int prio)
void ThreadImpl::startImpl(Runnable& target)
{
Mutex::ScopedLock lock(_mutex);
if (isRunningImpl())
throw SystemException("thread already running");
@@ -94,6 +96,8 @@ void ThreadImpl::startImpl(Runnable& target)
void ThreadImpl::startImpl(Callback target, void* pData)
{
Mutex::ScopedLock lock(_mutex);
if (isRunningImpl())
throw SystemException("thread already running");