diff options
Diffstat (limited to 'src/thread_none.cpp')
-rw-r--r-- | src/thread_none.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/thread_none.cpp b/src/thread_none.cpp index 34f8ca1ff..f0863efaf 100644 --- a/src/thread_none.cpp +++ b/src/thread_none.cpp @@ -10,3 +10,15 @@ if (thread != NULL) *thread = NULL; return false; } + +/** 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; +} |