8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 19:23:03 +01:00

Fix warning on Win64 build (#231)

This commit is contained in:
Dimitry Sibiryakov 2019-11-12 13:42:49 +01:00 committed by Dmitry Yemanov
parent bb0ed29e19
commit dac8634de9

View File

@ -309,13 +309,16 @@ ThreadId Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, H
* Advanced Windows by Richter pg. # 109. */ * Advanced Windows by Richter pg. # 109. */
unsigned thread_id; unsigned thread_id;
unsigned long real_handle = HANDLE handle =
_beginthreadex(NULL, 0, THREAD_ENTRYPOINT, THREAD_ARG, CREATE_SUSPENDED, &thread_id); reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, THREAD_ENTRYPOINT, THREAD_ARG, CREATE_SUSPENDED, &thread_id));
if (!real_handle) if (!handle)
{ {
// Though MSDN says that _beginthreadex() returns error in errno,
// GetLastError() still works because RTL call no other system
// functions after CreateThread() in the case of error.
// Watch out if it is ever changed.
Firebird::system_call_failed::raise("_beginthreadex", GetLastError()); Firebird::system_call_failed::raise("_beginthreadex", GetLastError());
} }
HANDLE handle = reinterpret_cast<HANDLE>(real_handle);
SetThreadPriority(handle, priority); SetThreadPriority(handle, priority);