diff --git a/include/boost/thread/win32/basic_timed_mutex.hpp b/include/boost/thread/win32/basic_timed_mutex.hpp index d20c6589..b579d505 100644 --- a/include/boost/thread/win32/basic_timed_mutex.hpp +++ b/include/boost/thread/win32/basic_timed_mutex.hpp @@ -55,7 +55,7 @@ namespace boost #endif if(old_event) { - win32::CloseHandle(old_event); + winapi::CloseHandle(old_event); } } @@ -81,9 +81,9 @@ namespace boost do { - unsigned const retval(win32::WaitForSingleObjectEx(sem, ::boost::detail::win32::infinite,0)); + unsigned const retval(winapi::WaitForSingleObjectEx(sem, ::boost::detail::win32::infinite,0)); BOOST_VERIFY(0 == retval || ::boost::detail::win32::wait_abandoned == retval); -// BOOST_VERIFY(win32::WaitForSingleObject( +// BOOST_VERIFY(winapi::WaitForSingleObject( // sem,::boost::detail::win32::infinite)==0); clear_waiting_and_try_lock(old_count); lock_acquired=!(old_count&lock_flag_value); @@ -142,7 +142,7 @@ namespace boost do { - if(win32::WaitForSingleObjectEx(sem,::boost::detail::get_milliseconds_until(wait_until),0)!=0) + if(winapi::WaitForSingleObjectEx(sem,::boost::detail::get_milliseconds_until(wait_until),0)!=0) { BOOST_INTERLOCKED_DECREMENT(&active_count); return false; @@ -210,7 +210,7 @@ namespace boost } chrono::milliseconds rel_time= chrono::ceil(tp-now); - if(win32::WaitForSingleObjectEx(sem,static_cast(rel_time.count()),0)!=0) + if(winapi::WaitForSingleObjectEx(sem,static_cast(rel_time.count()),0)!=0) { BOOST_INTERLOCKED_DECREMENT(&active_count); return false; @@ -232,7 +232,7 @@ namespace boost { if(!win32::interlocked_bit_test_and_set(&active_count,event_set_flag_bit)) { - win32::SetEvent(get_event()); + winapi::SetEvent(get_event()); } } } @@ -256,7 +256,7 @@ namespace boost #endif if(old_event!=0) { - win32::CloseHandle(new_event); + winapi::CloseHandle(new_event); return old_event; } else diff --git a/include/boost/thread/win32/condition_variable.hpp b/include/boost/thread/win32/condition_variable.hpp index 7f670bb9..5ff342f1 100644 --- a/include/boost/thread/win32/condition_variable.hpp +++ b/include/boost/thread/win32/condition_variable.hpp @@ -76,7 +76,7 @@ namespace boost void release(unsigned count_to_release) { notified=true; - detail::win32::ReleaseSemaphore(semaphore,count_to_release,0); + detail::winapi::ReleaseSemaphore(semaphore,count_to_release,0); } void release_waiters() @@ -96,7 +96,7 @@ namespace boost bool woken() { - unsigned long const woken_result=detail::win32::WaitForSingleObjectEx(wake_sem,0,0); + unsigned long const woken_result=detail::winapi::WaitForSingleObjectEx(wake_sem,0,0); BOOST_ASSERT((woken_result==detail::win32::timeout) || (woken_result==0)); return woken_result==0; } @@ -135,7 +135,7 @@ namespace boost void wake_waiters(long count_to_wake) { detail::interlocked_write_release(&total_count,total_count-count_to_wake); - detail::win32::ReleaseSemaphore(wake_sem,count_to_wake,0); + detail::winapi::ReleaseSemaphore(wake_sem,count_to_wake,0); } template diff --git a/include/boost/thread/win32/once.hpp b/include/boost/thread/win32/once.hpp index 24eb0f29..e7c565fb 100644 --- a/include/boost/thread/win32/once.hpp +++ b/include/boost/thread/win32/once.hpp @@ -124,7 +124,7 @@ namespace boost std::memcpy(mutex_name,fixed_mutex_name,sizeof(fixed_mutex_name)); detail::int_to_string(reinterpret_cast(flag_address), mutex_name + once_mutex_name_fixed_length); - detail::int_to_string(win32::GetCurrentProcessId(), + detail::int_to_string(winapi::GetCurrentProcessId(), mutex_name + once_mutex_name_fixed_length + sizeof(void*)*2); } @@ -136,9 +136,9 @@ namespace boost } #ifdef BOOST_NO_ANSI_APIS - return ::boost::detail::win32::OpenEventW( + return ::boost::detail::winapi::OpenEventW( #else - return ::boost::detail::win32::OpenEventA( + return ::boost::detail::winapi::OpenEventA( #endif ::boost::detail::win32::synchronize | ::boost::detail::win32::event_modify_state, @@ -186,7 +186,7 @@ namespace boost } if(ctx.event_handle) { - ::boost::detail::win32::ResetEvent(ctx.event_handle); + ::boost::detail::winapi::ResetEvent(ctx.event_handle); } return true; } @@ -207,7 +207,7 @@ namespace boost } if(ctx.event_handle) { - ::boost::detail::win32::SetEvent(ctx.event_handle); + ::boost::detail::winapi::SetEvent(ctx.event_handle); } } inline void rollback_once_region(once_flag& flag, once_context& ctx) BOOST_NOEXCEPT @@ -219,7 +219,7 @@ namespace boost } if(ctx.event_handle) { - ::boost::detail::win32::SetEvent(ctx.event_handle); + ::boost::detail::winapi::SetEvent(ctx.event_handle); } } } @@ -264,7 +264,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite, 0)); } } @@ -308,7 +308,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -355,7 +355,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -400,7 +400,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -443,7 +443,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -486,7 +486,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -529,7 +529,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -574,7 +574,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -617,7 +617,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -660,7 +660,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -703,7 +703,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -748,7 +748,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -793,7 +793,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -839,7 +839,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -886,7 +886,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -930,7 +930,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -977,7 +977,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -1024,7 +1024,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -1073,7 +1073,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } diff --git a/include/boost/thread/win32/thread_data.hpp b/include/boost/thread/win32/thread_data.hpp index 005f3ba5..ed74198f 100644 --- a/include/boost/thread/win32/thread_data.hpp +++ b/include/boost/thread/win32/thread_data.hpp @@ -153,7 +153,7 @@ namespace boost #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS void interrupt() { - BOOST_VERIFY(detail::win32::SetEvent(interruption_handle)!=0); + BOOST_VERIFY(detail::winapi::SetEvent(interruption_handle)!=0); } #endif typedef detail::win32::handle native_handle_type; diff --git a/include/boost/thread/win32/thread_primitives.hpp b/include/boost/thread/win32/thread_primitives.hpp index 133cc9c7..7e80abd9 100644 --- a/include/boost/thread/win32/thread_primitives.hpp +++ b/include/boost/thread/win32/thread_primitives.hpp @@ -17,6 +17,20 @@ #include #include #include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + //#include #include #include @@ -25,9 +39,6 @@ #include #endif -#if defined( BOOST_USE_WINDOWS_H ) -# include - namespace boost { namespace detail @@ -35,190 +46,22 @@ namespace boost namespace win32 { typedef HANDLE handle; - typedef SYSTEM_INFO system_info; + typedef ::boost::detail::winapi::SYSTEM_INFO_ system_info; typedef unsigned __int64 ticks_type; - typedef FARPROC farproc_t; - unsigned const infinite=INFINITE; - unsigned const timeout=WAIT_TIMEOUT; - handle const invalid_handle_value=INVALID_HANDLE_VALUE; - unsigned const event_modify_state=EVENT_MODIFY_STATE; - unsigned const synchronize=SYNCHRONIZE; - unsigned const wait_abandoned=WAIT_ABANDONED; + typedef ::boost::detail::winapi::FARPROC_ farproc_t; + unsigned const infinite=::boost::detail::winapi::INFINITE_; + unsigned const timeout=::boost::detail::winapi::WAIT_TIMEOUT_; + handle const invalid_handle_value=::boost::detail::winapi::INVALID_HANDLE_VALUE_; + unsigned const event_modify_state=::boost::detail::winapi::EVENT_MODIFY_STATE_; + unsigned const synchronize=::boost::detail::winapi::SYNCHRONIZE_; + unsigned const wait_abandoned=::boost::detail::winapi::WAIT_ABANDONED_; unsigned const create_event_initial_set = 0x00000002; unsigned const create_event_manual_reset = 0x00000001; - unsigned const event_all_access = EVENT_ALL_ACCESS; - unsigned const semaphore_all_access = SEMAPHORE_ALL_ACCESS; - - -# ifdef BOOST_NO_ANSI_APIS -# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA - using ::CreateMutexW; - using ::CreateEventW; - using ::CreateSemaphoreW; -# else - using ::CreateMutexExW; - using ::CreateEventExW; - using ::CreateSemaphoreExW; -# endif - using ::OpenEventW; - using ::GetModuleHandleW; -# else - using ::CreateMutexA; - using ::CreateEventA; - using ::OpenEventA; - using ::CreateSemaphoreA; - using ::GetModuleHandleA; -# endif -#if BOOST_PLAT_WINDOWS_RUNTIME - using ::GetNativeSystemInfo; - using ::GetTickCount64; -#else - using ::GetSystemInfo; - using ::GetTickCount; -#endif - using ::CloseHandle; - using ::ReleaseMutex; - using ::ReleaseSemaphore; - using ::SetEvent; - using ::ResetEvent; - using ::WaitForMultipleObjectsEx; - using ::WaitForSingleObjectEx; - using ::GetCurrentProcessId; - using ::GetCurrentThreadId; - using ::GetCurrentThread; - using ::GetCurrentProcess; - using ::DuplicateHandle; -#if !BOOST_PLAT_WINDOWS_RUNTIME - using ::SleepEx; - using ::Sleep; - using ::QueueUserAPC; - using ::GetProcAddress; -#endif + unsigned const event_all_access = ::boost::detail::winapi::EVENT_ALL_ACCESS_; + unsigned const semaphore_all_access = boost::detail::winapi::SEMAPHORE_ALL_ACCESS_; } } } -#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) - -# ifdef UNDER_CE -# ifndef WINAPI -# ifndef _WIN32_WCE_EMULATION -# define WINAPI __cdecl // Note this doesn't match the desktop definition -# else -# define WINAPI __stdcall -# endif -# endif - -# ifdef __cplusplus -extern "C" { -# endif -typedef int BOOL; -typedef unsigned long DWORD; -typedef void* HANDLE; -# include -# ifdef __cplusplus -} -# endif -# endif - -# ifdef __cplusplus -extern "C" { -# endif -struct _SYSTEM_INFO; -# ifdef __cplusplus -} -#endif - -namespace boost -{ - namespace detail - { - namespace win32 - { -# ifdef _WIN64 - typedef unsigned __int64 ulong_ptr; -# else - typedef unsigned long ulong_ptr; -# endif - typedef void* handle; - typedef _SYSTEM_INFO system_info; - typedef unsigned __int64 ticks_type; - typedef int (__stdcall *farproc_t)(); - unsigned const infinite=~0U; - unsigned const timeout=258U; - handle const invalid_handle_value=(handle)(-1); - unsigned const event_modify_state=2; - unsigned const synchronize=0x100000u; - unsigned const wait_abandoned=0x00000080u; - unsigned const create_event_initial_set = 0x00000002; - unsigned const create_event_manual_reset = 0x00000001; - unsigned const event_all_access = 0x1F0003; - unsigned const semaphore_all_access = 0x1F0003; - - extern "C" - { - struct _SECURITY_ATTRIBUTES; -# ifdef BOOST_NO_ANSI_APIS -# if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA - __declspec(dllimport) void* __stdcall CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*); - __declspec(dllimport) void* __stdcall CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*); - __declspec(dllimport) void* __stdcall CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*); -# else - __declspec(dllimport) void* __stdcall CreateMutexExW(_SECURITY_ATTRIBUTES*,wchar_t const*,unsigned long,unsigned long); - __declspec(dllimport) void* __stdcall CreateEventExW(_SECURITY_ATTRIBUTES*,wchar_t const*,unsigned long,unsigned long); - __declspec(dllimport) void* __stdcall CreateSemaphoreExW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*,unsigned long,unsigned long); -# endif - __declspec(dllimport) void* __stdcall OpenEventW(unsigned long,int,wchar_t const*); - __declspec(dllimport) void* __stdcall GetModuleHandleW(wchar_t const*); -# else - __declspec(dllimport) void* __stdcall CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*); - __declspec(dllimport) void* __stdcall CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*); - __declspec(dllimport) void* __stdcall CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*); - __declspec(dllimport) void* __stdcall OpenEventA(unsigned long,int,char const*); - __declspec(dllimport) void* __stdcall GetModuleHandleA(char const*); -# endif -#if BOOST_PLAT_WINDOWS_RUNTIME - __declspec(dllimport) void __stdcall GetNativeSystemInfo(_SYSTEM_INFO*); - __declspec(dllimport) ticks_type __stdcall GetTickCount64(); -#else - __declspec(dllimport) void __stdcall GetSystemInfo(_SYSTEM_INFO*); - __declspec(dllimport) unsigned long __stdcall GetTickCount(); -#endif - __declspec(dllimport) int __stdcall CloseHandle(void*); - __declspec(dllimport) int __stdcall ReleaseMutex(void*); - __declspec(dllimport) unsigned long __stdcall WaitForSingleObjectEx(void*,unsigned long,int); - __declspec(dllimport) unsigned long __stdcall WaitForMultipleObjectsEx(unsigned long nCount,void* const * lpHandles,int bWaitAll,unsigned long dwMilliseconds,int bAlertable); - __declspec(dllimport) int __stdcall ReleaseSemaphore(void*,long,long*); - __declspec(dllimport) int __stdcall DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long); -#if !BOOST_PLAT_WINDOWS_RUNTIME - __declspec(dllimport) unsigned long __stdcall SleepEx(unsigned long,int); - __declspec(dllimport) void __stdcall Sleep(unsigned long); - typedef void (__stdcall *queue_user_apc_callback_function)(ulong_ptr); - __declspec(dllimport) unsigned long __stdcall QueueUserAPC(queue_user_apc_callback_function,void*,ulong_ptr); - __declspec(dllimport) farproc_t __stdcall GetProcAddress(void *, const char *); -#endif - -# ifndef UNDER_CE - __declspec(dllimport) unsigned long __stdcall GetCurrentProcessId(); - __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(); - __declspec(dllimport) void* __stdcall GetCurrentThread(); - __declspec(dllimport) void* __stdcall GetCurrentProcess(); - __declspec(dllimport) int __stdcall SetEvent(void*); - __declspec(dllimport) int __stdcall ResetEvent(void*); -# else - using ::GetCurrentProcessId; - using ::GetCurrentThreadId; - using ::GetCurrentThread; - using ::GetCurrentProcess; - using ::SetEvent; - using ::ResetEvent; -# endif - } - } - } -} -#else -# error "Win32 functions not available" -#endif #include @@ -250,7 +93,7 @@ namespace boost ticks_type current_tick64; previous_count = (unsigned long) boost::detail::interlocked_read_acquire(&count); - current_tick32 = GetTickCount(); + current_tick32 = ::boost::detail::winapi::GetTickCount(); if(previous_count == (unsigned long)-1l) { @@ -302,13 +145,13 @@ namespace boost // GetTickCount and GetModuleHandle are not allowed in the Windows Runtime, // and kernel32 isn't used in Windows Phone. #if BOOST_PLAT_WINDOWS_RUNTIME - gettickcount64impl = &GetTickCount64; + gettickcount64impl = &::boost::detail::winapi::GetTickCount64; #else farproc_t addr=GetProcAddress( #if !defined(BOOST_NO_ANSI_APIS) - GetModuleHandleA("KERNEL32.DLL"), + ::boost::detail::winapi::GetModuleHandleA("KERNEL32.DLL"), #else - GetModuleHandleW(L"KERNEL32.DLL"), + ::boost::detail::winapi::GetModuleHandleW(L"KERNEL32.DLL"), #endif "GetTickCount64"); if(addr) @@ -341,11 +184,11 @@ namespace boost initial_event_state state) { #if !defined(BOOST_NO_ANSI_APIS) - handle const res = win32::CreateEventA(0, type, state, mutex_name); + handle const res = ::boost::detail::winapi::CreateEventA(0, type, state, mutex_name); #elif BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA - handle const res = win32::CreateEventW(0, type, state, mutex_name); + handle const res = ::boost::detail::winapi::CreateEventW(0, type, state, mutex_name); #else - handle const res = win32::CreateEventExW( + handle const res = ::boost::detail::winapi::CreateEventExW( 0, mutex_name, type ? create_event_manual_reset : 0 | state ? create_event_initial_set : 0, @@ -367,12 +210,12 @@ namespace boost inline handle create_anonymous_semaphore_nothrow(long initial_count,long max_count) { #if !defined(BOOST_NO_ANSI_APIS) - handle const res=win32::CreateSemaphoreA(0,initial_count,max_count,0); + handle const res=::boost::detail::winapi::CreateSemaphoreA(0,initial_count,max_count,0); #else #if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA - handle const res=win32::CreateSemaphoreEx(0,initial_count,max_count,0,0); + handle const res=::boost::detail::winapi::CreateSemaphoreEx(0,initial_count,max_count,0,0); #else - handle const res=win32::CreateSemaphoreExW(0,initial_count,max_count,0,0,semaphore_all_access); + handle const res=::boost::detail::winapi::CreateSemaphoreExW(0,initial_count,max_count,0,0,semaphore_all_access); #endif #endif return res; @@ -390,10 +233,10 @@ namespace boost inline handle duplicate_handle(handle source) { - handle const current_process=GetCurrentProcess(); + handle const current_process=::boost::detail::winapi::GetCurrentProcess(); long const same_access_flag=2; handle new_handle=0; - bool const success=DuplicateHandle(current_process,source,current_process,&new_handle,0,false,same_access_flag)!=0; + bool const success=::boost::detail::winapi::DuplicateHandle(current_process,source,current_process,&new_handle,0,false,same_access_flag)!=0; if(!success) { boost::throw_exception(thread_resource_error()); @@ -403,15 +246,15 @@ namespace boost inline void release_semaphore(handle semaphore,long count) { - BOOST_VERIFY(ReleaseSemaphore(semaphore,count,0)!=0); + BOOST_VERIFY(::boost::detail::winapi::ReleaseSemaphore(semaphore,count,0)!=0); } inline void get_system_info(system_info *info) { #if BOOST_PLAT_WINDOWS_RUNTIME - win32::GetNativeSystemInfo(info); + ::boost::detail::winapi::GetNativeSystemInfo(info); #else - win32::GetSystemInfo(info); + ::boost::detail::winapi::GetSystemInfo(info); #endif } @@ -422,15 +265,15 @@ namespace boost #if BOOST_PLAT_WINDOWS_RUNTIME std::this_thread::yield(); #else - ::boost::detail::win32::Sleep(0); + ::boost::detail::winapi::Sleep(0); #endif } else { #if BOOST_PLAT_WINDOWS_RUNTIME - ::boost::detail::win32::WaitForSingleObjectEx(::boost::detail::win32::GetCurrentThread(), milliseconds, 0); + ::boost::detail::winapi::WaitForSingleObjectEx(::boost::detail::winapi::GetCurrentThread(), milliseconds, 0); #else - ::boost::detail::win32::Sleep(milliseconds); + ::boost::detail::winapi::Sleep(milliseconds); #endif } } @@ -446,7 +289,7 @@ namespace boost { if (m_completionHandle != ::boost::detail::win32::invalid_handle_value) { - CloseHandle(m_completionHandle); + ::boost::detail::winapi::CloseHandle(m_completionHandle); } } @@ -474,7 +317,7 @@ namespace boost { if(handle_to_manage && handle_to_manage!=invalid_handle_value) { - BOOST_VERIFY(CloseHandle(handle_to_manage)); + BOOST_VERIFY(::boost::detail::winapi::CloseHandle(handle_to_manage)); } } diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 988ee416..3d9fc88f 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -508,7 +508,7 @@ namespace boost bool thread::interruption_requested() const BOOST_NOEXCEPT { detail::thread_data_ptr local_thread_info=(get_thread_info)(); - return local_thread_info.get() && (detail::win32::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0); + return local_thread_info.get() && (detail::winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0); } #endif @@ -738,7 +738,7 @@ namespace boost if(handle_count) { - unsigned long const notified_index=detail::win32::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); + unsigned long const notified_index=detail::winapi::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); if(notified_indexinterruption_handle); + detail::winapi::ResetEvent(detail::get_current_thread_data()->interruption_handle); throw thread_interrupted(); } #endif @@ -823,7 +823,7 @@ namespace boost if(handle_count) { - unsigned long const notified_index=detail::win32::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); + unsigned long const notified_index=detail::winapi::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); if(notified_indexid; } #endif - return detail::win32::GetCurrentThreadId(); + return detail::winapi::GetCurrentThreadId(); #else return thread::id(get_or_make_current_thread_data()); #endif @@ -871,7 +871,7 @@ namespace boost { if(interruption_enabled() && interruption_requested()) { - detail::win32::ResetEvent(detail::get_current_thread_data()->interruption_handle); + detail::winapi::ResetEvent(detail::get_current_thread_data()->interruption_handle); throw thread_interrupted(); } } @@ -883,7 +883,7 @@ namespace boost bool interruption_requested() BOOST_NOEXCEPT { - return detail::get_current_thread_data() && (detail::win32::WaitForSingleObjectEx(detail::get_current_thread_data()->interruption_handle,0,0)==0); + return detail::get_current_thread_data() && (detail::winapi::WaitForSingleObjectEx(detail::get_current_thread_data()->interruption_handle,0,0)==0); } #endif