summaryrefslogtreecommitdiff
path: root/src/thread/thread_win32.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-03-03 22:25:13 +0000
committerMichael Lutz <michi@icosahedron.de>2019-03-24 16:10:04 +0100
commitaf7d9020a15c1b1a14b3981ac73c70d2e58cc877 (patch)
tree1dcff3e01382ea3a0a4733a4637659dbbfd4bad5 /src/thread/thread_win32.cpp
parent31260e66252fb4d0dda6f992520faeeb96929cfe (diff)
downloadopenttd-af7d9020a15c1b1a14b3981ac73c70d2e58cc877.tar.xz
Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual member declaration overrides a base-class member with the same signature. Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked as virtual despite being a template.
Diffstat (limited to 'src/thread/thread_win32.cpp')
-rw-r--r--src/thread/thread_win32.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/thread/thread_win32.cpp b/src/thread/thread_win32.cpp
index a01ea8e10..506faa069 100644
--- a/src/thread/thread_win32.cpp
+++ b/src/thread/thread_win32.cpp
@@ -49,7 +49,7 @@ public:
ResumeThread(this->thread);
}
- /* virtual */ ~ThreadObject_Win32()
+ ~ThreadObject_Win32() override
{
if (this->thread != NULL) {
CloseHandle(this->thread);
@@ -57,14 +57,14 @@ public:
}
}
- /* virtual */ bool Exit()
+ bool Exit() override
{
assert(GetCurrentThreadId() == this->id);
/* For now we terminate by throwing an error, gives much cleaner cleanup */
throw OTTDThreadExitSignal();
}
- /* virtual */ void Join()
+ void Join() override
{
/* You cannot join yourself */
assert(GetCurrentThreadId() != this->id);
@@ -126,13 +126,13 @@ public:
this->event = CreateEvent(NULL, FALSE, FALSE, NULL);
}
- /* virtual */ ~ThreadMutex_Win32()
+ ~ThreadMutex_Win32() override
{
DeleteCriticalSection(&this->critical_section);
CloseHandle(this->event);
}
- /* virtual */ void BeginCritical(bool allow_recursive = false)
+ void BeginCritical(bool allow_recursive = false) override
{
/* windows mutex is recursive by itself */
EnterCriticalSection(&this->critical_section);
@@ -140,14 +140,14 @@ public:
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
}
- /* virtual */ void EndCritical(bool allow_recursive = false)
+ void EndCritical(bool allow_recursive = false) override
{
if (!allow_recursive && this->recursive_count != 1) NOT_REACHED();
this->recursive_count--;
LeaveCriticalSection(&this->critical_section);
}
- /* virtual */ void WaitForSignal()
+ void WaitForSignal() override
{
assert(this->recursive_count == 1); // Do we need to call Begin/EndCritical multiple times otherwise?
this->EndCritical();
@@ -155,7 +155,7 @@ public:
this->BeginCritical();
}
- /* virtual */ void SendSignal()
+ void SendSignal() override
{
SetEvent(this->event);
}