2008-04-14 20:54:33 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/** @file thread_none.cpp No-Threads-Available implementation of Threads */
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "thread.h"
|
|
|
|
|
2009-01-20 03:12:46 +00:00
|
|
|
/* static */ bool ThreadObject::New(OTTDThreadFunc proc, void *param, ThreadObject **thread)
|
2008-04-14 20:54:33 +01:00
|
|
|
{
|
2009-01-20 03:12:46 +00:00
|
|
|
if (thread != NULL) *thread = NULL;
|
|
|
|
return false;
|
2008-04-14 20:54:33 +01:00
|
|
|
}
|
2009-01-20 03:44:43 +00:00
|
|
|
|
|
|
|
/** Mutex that doesn't do locking because it ain't needed when there're no threads */
|
|
|
|
class ThreadMutex_None : ThreadMutex {
|
|
|
|
public:
|
|
|
|
virtual void BeginCritical() {}
|
|
|
|
virtual void EndCritical() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* static */ ThreadMutex *ThreadMutex::New()
|
|
|
|
{
|
|
|
|
return new ThreadMutex_None;
|
|
|
|
}
|