From 1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 27 Mar 2022 22:11:07 +0200 Subject: Replaced ThreadSync with stl's mutex --- FoundationEx/ThreadSync.h | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 FoundationEx/ThreadSync.h (limited to 'FoundationEx') diff --git a/FoundationEx/ThreadSync.h b/FoundationEx/ThreadSync.h deleted file mode 100644 index ccf79f4..0000000 --- a/FoundationEx/ThreadSync.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Starshatter: The Open Source Project - Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors - Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors - Copyright (c) 1997-2006, Destroyer Studios LLC. - - AUTHOR: John DiCamillo - - - OVERVIEW - ======== - Declaration of the ThreadSync class -*/ - -#ifndef ThreadSync_h -#define ThreadSync_h - -#include - -// +-------------------------------------------------------------------+ - -class ThreadSync -{ -#if defined(_MT) // MULTITHREADED: WITH SYNC ------------ - CRITICAL_SECTION sync; - -public: - ThreadSync() { ::InitializeCriticalSection(&sync); } - ~ThreadSync() { ::DeleteCriticalSection(&sync); } - - void acquire() { ::EnterCriticalSection(&sync); } - void release() { ::LeaveCriticalSection(&sync); } - -#else // SINGLE THREADED: NO SYNC ------------ - -public: - ThreadSync() { } - ~ThreadSync() { } - - void acquire() { } - void release() { } - -#endif -}; - -// +-------------------------------------------------------------------+ - -class AutoThreadSync -{ -public: - AutoThreadSync(ThreadSync& s) : sync(s) { sync.acquire(); } - ~AutoThreadSync() { sync.release(); } -private: - ThreadSync& sync; -}; - -#endif // ThreadSync_h -- cgit v1.1