From 343230cd783ce59e3dd514742cfd62948d0044cc Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 25 Oct 2017 01:09:24 +0300 Subject: [PATCH] Updated Boost.WinAPI usage to the new location and namespace. --- .../thread/win32/basic_recursive_mutex.hpp | 10 +- .../boost/thread/win32/condition_variable.hpp | 6 +- include/boost/thread/win32/once.hpp | 48 +++++----- include/boost/thread/win32/shared_mutex.hpp | 30 +++--- include/boost/thread/win32/thread_data.hpp | 2 +- .../boost/thread/win32/thread_heap_alloc.hpp | 6 +- .../boost/thread/win32/thread_primitives.hpp | 92 +++++++++---------- src/win32/thread.cpp | 16 ++-- src/win32/tss_dll.cpp | 2 +- src/win32/tss_pe.cpp | 2 +- 10 files changed, 107 insertions(+), 107 deletions(-) diff --git a/include/boost/thread/win32/basic_recursive_mutex.hpp b/include/boost/thread/win32/basic_recursive_mutex.hpp index 351f9acc..f232d1fb 100644 --- a/include/boost/thread/win32/basic_recursive_mutex.hpp +++ b/include/boost/thread/win32/basic_recursive_mutex.hpp @@ -44,13 +44,13 @@ namespace boost bool try_lock() BOOST_NOEXCEPT { - long const current_thread_id=boost::detail::winapi::GetCurrentThreadId(); + long const current_thread_id=boost::winapi::GetCurrentThreadId(); return try_recursive_lock(current_thread_id) || try_basic_lock(current_thread_id); } void lock() { - long const current_thread_id=boost::detail::winapi::GetCurrentThreadId(); + long const current_thread_id=boost::winapi::GetCurrentThreadId(); if(!try_recursive_lock(current_thread_id)) { mutex.lock(); @@ -61,7 +61,7 @@ namespace boost #if defined BOOST_THREAD_USES_DATETIME bool timed_lock(::boost::system_time const& target) { - long const current_thread_id=boost::detail::winapi::GetCurrentThreadId(); + long const current_thread_id=boost::winapi::GetCurrentThreadId(); return try_recursive_lock(current_thread_id) || try_timed_lock(current_thread_id,target); } template @@ -75,13 +75,13 @@ namespace boost template bool try_lock_for(const chrono::duration& rel_time) { - long const current_thread_id=boost::detail::winapi::GetCurrentThreadId(); + long const current_thread_id=boost::winapi::GetCurrentThreadId(); return try_recursive_lock(current_thread_id) || try_timed_lock_for(current_thread_id,rel_time); } template bool try_lock_until(const chrono::time_point& t) { - long const current_thread_id=boost::detail::winapi::GetCurrentThreadId(); + long const current_thread_id=boost::winapi::GetCurrentThreadId(); return try_recursive_lock(current_thread_id) || try_timed_lock_until(current_thread_id,t); } #endif diff --git a/include/boost/thread/win32/condition_variable.hpp b/include/boost/thread/win32/condition_variable.hpp index 5ff342f1..f3f7544c 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::winapi::ReleaseSemaphore(semaphore,count_to_release,0); + winapi::ReleaseSemaphore(semaphore,count_to_release,0); } void release_waiters() @@ -96,7 +96,7 @@ namespace boost bool woken() { - unsigned long const woken_result=detail::winapi::WaitForSingleObjectEx(wake_sem,0,0); + unsigned long const woken_result=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::winapi::ReleaseSemaphore(wake_sem,count_to_wake,0); + 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 e7c565fb..56d684cc 100644 --- a/include/boost/thread/win32/once.hpp +++ b/include/boost/thread/win32/once.hpp @@ -136,9 +136,9 @@ namespace boost } #ifdef BOOST_NO_ANSI_APIS - return ::boost::detail::winapi::OpenEventW( + return ::boost::winapi::OpenEventW( #else - return ::boost::detail::winapi::OpenEventA( + return ::boost::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::winapi::ResetEvent(ctx.event_handle); + ::boost::winapi::ResetEvent(ctx.event_handle); } return true; } @@ -207,7 +207,7 @@ namespace boost } if(ctx.event_handle) { - ::boost::detail::winapi::SetEvent(ctx.event_handle); + ::boost::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::winapi::SetEvent(ctx.event_handle); + ::boost::winapi::SetEvent(ctx.event_handle); } } } @@ -264,7 +264,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite, 0)); } } @@ -308,7 +308,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -355,7 +355,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -400,7 +400,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -443,7 +443,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -486,7 +486,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -529,7 +529,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -574,7 +574,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -617,7 +617,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -660,7 +660,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -703,7 +703,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -748,7 +748,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -793,7 +793,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -839,7 +839,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -886,7 +886,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -930,7 +930,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -977,7 +977,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -1024,7 +1024,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } @@ -1073,7 +1073,7 @@ namespace boost continue; } } - BOOST_VERIFY(!::boost::detail::winapi::WaitForSingleObjectEx( + BOOST_VERIFY(!::boost::winapi::WaitForSingleObjectEx( ctx.event_handle,::boost::detail::win32::infinite,0)); } } diff --git a/include/boost/thread/win32/shared_mutex.hpp b/include/boost/thread/win32/shared_mutex.hpp index d1bd9717..4482ed29 100644 --- a/include/boost/thread/win32/shared_mutex.hpp +++ b/include/boost/thread/win32/shared_mutex.hpp @@ -67,19 +67,19 @@ namespace boost { if(old_state.exclusive_waiting) { - BOOST_VERIFY(detail::winapi::ReleaseSemaphore(semaphores[exclusive_sem],1,0)!=0); + BOOST_VERIFY(winapi::ReleaseSemaphore(semaphores[exclusive_sem],1,0)!=0); } if(old_state.shared_waiting || old_state.exclusive_waiting) { - BOOST_VERIFY(detail::winapi::ReleaseSemaphore(semaphores[unlock_sem],old_state.shared_waiting + (old_state.exclusive_waiting?1:0),0)!=0); + BOOST_VERIFY(winapi::ReleaseSemaphore(semaphores[unlock_sem],old_state.shared_waiting + (old_state.exclusive_waiting?1:0),0)!=0); } } void release_shared_waiters(state_data old_state) { if(old_state.shared_waiting || old_state.exclusive_waiting) { - BOOST_VERIFY(detail::winapi::ReleaseSemaphore(semaphores[unlock_sem],old_state.shared_waiting + (old_state.exclusive_waiting?1:0),0)!=0); + BOOST_VERIFY(winapi::ReleaseSemaphore(semaphores[unlock_sem],old_state.shared_waiting + (old_state.exclusive_waiting?1:0),0)!=0); } } @@ -107,9 +107,9 @@ namespace boost ~shared_mutex() { - detail::winapi::CloseHandle(upgrade_sem); - detail::winapi::CloseHandle(semaphores[unlock_sem]); - detail::winapi::CloseHandle(semaphores[exclusive_sem]); + winapi::CloseHandle(upgrade_sem); + winapi::CloseHandle(semaphores[unlock_sem]); + winapi::CloseHandle(semaphores[exclusive_sem]); } bool try_lock_shared() @@ -191,7 +191,7 @@ namespace boost return true; } - unsigned long const res=detail::winapi::WaitForSingleObjectEx(semaphores[unlock_sem],::boost::detail::get_milliseconds_until(wait_until), 0); + unsigned long const res=winapi::WaitForSingleObjectEx(semaphores[unlock_sem],::boost::detail::get_milliseconds_until(wait_until), 0); if(res==detail::win32::timeout) { for(;;) @@ -296,7 +296,7 @@ namespace boost unsigned long res; if (tp>n) { chrono::milliseconds rel_time= chrono::ceil(tp-n); - res=detail::winapi::WaitForSingleObjectEx(semaphores[unlock_sem], + res=winapi::WaitForSingleObjectEx(semaphores[unlock_sem], static_cast(rel_time.count()), 0); } else { res=detail::win32::timeout; @@ -375,7 +375,7 @@ namespace boost { if(old_state.upgrade) { - BOOST_VERIFY(detail::winapi::ReleaseSemaphore(upgrade_sem,1,0)!=0); + BOOST_VERIFY(winapi::ReleaseSemaphore(upgrade_sem,1,0)!=0); } else { @@ -474,7 +474,7 @@ namespace boost #else const bool wait_all = false; #endif - unsigned long const wait_res=detail::winapi::WaitForMultipleObjectsEx(2,semaphores,wait_all,::boost::detail::get_milliseconds_until(wait_until), 0); + unsigned long const wait_res=winapi::WaitForMultipleObjectsEx(2,semaphores,wait_all,::boost::detail::get_milliseconds_until(wait_until), 0); if(wait_res==detail::win32::timeout) { for(;;) @@ -500,7 +500,7 @@ namespace boost state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); if (must_notify) { - BOOST_VERIFY(detail::winapi::ReleaseSemaphore(semaphores[unlock_sem],1,0)!=0); + BOOST_VERIFY(winapi::ReleaseSemaphore(semaphores[unlock_sem],1,0)!=0); } if(current_state==old_state) @@ -586,7 +586,7 @@ namespace boost unsigned long wait_res; if (tp>n) { chrono::milliseconds rel_time= chrono::ceil(tp-chrono::system_clock::now()); - wait_res=detail::winapi::WaitForMultipleObjectsEx(2,semaphores,wait_all, + wait_res=winapi::WaitForMultipleObjectsEx(2,semaphores,wait_all, static_cast(rel_time.count()), 0); } else { wait_res=detail::win32::timeout; @@ -616,7 +616,7 @@ namespace boost state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); if (must_notify) { - BOOST_VERIFY(detail::winapi::ReleaseSemaphore(semaphores[unlock_sem],1,0)!=0); + BOOST_VERIFY(winapi::ReleaseSemaphore(semaphores[unlock_sem],1,0)!=0); } if(current_state==old_state) { @@ -698,7 +698,7 @@ namespace boost return; } - BOOST_VERIFY(!detail::winapi::WaitForSingleObjectEx(semaphores[unlock_sem],detail::winapi::infinite, 0)); + BOOST_VERIFY(!winapi::WaitForSingleObjectEx(semaphores[unlock_sem],winapi::infinite, 0)); } } @@ -790,7 +790,7 @@ namespace boost { if(!last_reader) { - BOOST_VERIFY(!detail::winapi::WaitForSingleObjectEx(upgrade_sem,detail::win32::infinite, 0)); + BOOST_VERIFY(!winapi::WaitForSingleObjectEx(upgrade_sem,detail::win32::infinite, 0)); } break; } diff --git a/include/boost/thread/win32/thread_data.hpp b/include/boost/thread/win32/thread_data.hpp index ed74198f..db8678cb 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::winapi::SetEvent(interruption_handle)!=0); + BOOST_VERIFY(winapi::SetEvent(interruption_handle)!=0); } #endif typedef detail::win32::handle native_handle_type; diff --git a/include/boost/thread/win32/thread_heap_alloc.hpp b/include/boost/thread/win32/thread_heap_alloc.hpp index 96621355..176d269e 100644 --- a/include/boost/thread/win32/thread_heap_alloc.hpp +++ b/include/boost/thread/win32/thread_heap_alloc.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include @@ -22,7 +22,7 @@ namespace boost { inline void* allocate_raw_heap_memory(unsigned size) { - void* const heap_memory=detail::winapi::HeapAlloc(detail::winapi::GetProcessHeap(),0,size); + void* const heap_memory=winapi::HeapAlloc(winapi::GetProcessHeap(),0,size); if(!heap_memory) { boost::throw_exception(std::bad_alloc()); @@ -32,7 +32,7 @@ namespace boost inline void free_raw_heap_memory(void* heap_memory) { - BOOST_VERIFY(detail::winapi::HeapFree(detail::winapi::GetProcessHeap(),0,heap_memory)!=0); + BOOST_VERIFY(winapi::HeapFree(winapi::GetProcessHeap(),0,heap_memory)!=0); } #if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) && ! defined (BOOST_NO_CXX11_RVALUE_REFERENCES) template diff --git a/include/boost/thread/win32/thread_primitives.hpp b/include/boost/thread/win32/thread_primitives.hpp index f93cc243..c9abc44f 100644 --- a/include/boost/thread/win32/thread_primitives.hpp +++ b/include/boost/thread/win32/thread_primitives.hpp @@ -16,23 +16,23 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -//#include +//#include #include #include @@ -46,20 +46,20 @@ namespace boost { namespace win32 { - typedef ::boost::detail::winapi::HANDLE_ handle; - typedef ::boost::detail::winapi::SYSTEM_INFO_ system_info; + typedef ::boost::winapi::HANDLE_ handle; + typedef ::boost::winapi::SYSTEM_INFO_ system_info; typedef unsigned __int64 ticks_type; - 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_; + typedef ::boost::winapi::FARPROC_ farproc_t; + unsigned const infinite=::boost::winapi::INFINITE_; + unsigned const timeout=::boost::winapi::WAIT_TIMEOUT_; + handle const invalid_handle_value=::boost::winapi::INVALID_HANDLE_VALUE_; + unsigned const event_modify_state=::boost::winapi::EVENT_MODIFY_STATE_; + unsigned const synchronize=::boost::winapi::SYNCHRONIZE_; + unsigned const wait_abandoned=::boost::winapi::WAIT_ABANDONED_; unsigned const create_event_initial_set = 0x00000002; unsigned const create_event_manual_reset = 0x00000001; - unsigned const event_all_access = ::boost::detail::winapi::EVENT_ALL_ACCESS_; - unsigned const semaphore_all_access = boost::detail::winapi::SEMAPHORE_ALL_ACCESS_; + unsigned const event_all_access = ::boost::winapi::EVENT_ALL_ACCESS_; + unsigned const semaphore_all_access = boost::winapi::SEMAPHORE_ALL_ACCESS_; } } } @@ -94,7 +94,7 @@ namespace boost ticks_type current_tick64; previous_count = (unsigned long) boost::detail::interlocked_read_acquire(&count); - current_tick32 = ::boost::detail::winapi::GetTickCount(); + current_tick32 = ::boost::winapi::GetTickCount(); if(previous_count == (unsigned long)-1l) { @@ -146,13 +146,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 = &::boost::detail::winapi::GetTickCount64; + gettickcount64impl = &::boost::winapi::GetTickCount64; #else farproc_t addr=GetProcAddress( #if !defined(BOOST_NO_ANSI_APIS) - ::boost::detail::winapi::GetModuleHandleA("KERNEL32.DLL"), + ::boost::winapi::GetModuleHandleA("KERNEL32.DLL"), #else - ::boost::detail::winapi::GetModuleHandleW(L"KERNEL32.DLL"), + ::boost::winapi::GetModuleHandleW(L"KERNEL32.DLL"), #endif "GetTickCount64"); if(addr) @@ -185,11 +185,11 @@ namespace boost initial_event_state state) { #if !defined(BOOST_NO_ANSI_APIS) - handle const res = ::boost::detail::winapi::CreateEventA(0, type, state, mutex_name); + handle const res = ::boost::winapi::CreateEventA(0, type, state, mutex_name); #elif BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA - handle const res = ::boost::detail::winapi::CreateEventW(0, type, state, mutex_name); + handle const res = ::boost::winapi::CreateEventW(0, type, state, mutex_name); #else - handle const res = ::boost::detail::winapi::CreateEventExW( + handle const res = ::boost::winapi::CreateEventExW( 0, mutex_name, type ? create_event_manual_reset : 0 | state ? create_event_initial_set : 0, @@ -211,12 +211,12 @@ namespace boost inline handle create_anonymous_semaphore_nothrow(long initial_count,long max_count) { #if !defined(BOOST_NO_ANSI_APIS) - handle const res=::boost::detail::winapi::CreateSemaphoreA(0,initial_count,max_count,0); + handle const res=::boost::winapi::CreateSemaphoreA(0,initial_count,max_count,0); #else #if BOOST_USE_WINAPI_VERSION < BOOST_WINAPI_VERSION_VISTA - handle const res=::boost::detail::winapi::CreateSemaphoreEx(0,initial_count,max_count,0,0); + handle const res=::boost::winapi::CreateSemaphoreEx(0,initial_count,max_count,0,0); #else - handle const res=::boost::detail::winapi::CreateSemaphoreExW(0,initial_count,max_count,0,0,semaphore_all_access); + handle const res=::boost::winapi::CreateSemaphoreExW(0,initial_count,max_count,0,0,semaphore_all_access); #endif #endif return res; @@ -234,10 +234,10 @@ namespace boost inline handle duplicate_handle(handle source) { - handle const current_process=::boost::detail::winapi::GetCurrentProcess(); + handle const current_process=::boost::winapi::GetCurrentProcess(); long const same_access_flag=2; handle new_handle=0; - bool const success=::boost::detail::winapi::DuplicateHandle(current_process,source,current_process,&new_handle,0,false,same_access_flag)!=0; + bool const success=::boost::winapi::DuplicateHandle(current_process,source,current_process,&new_handle,0,false,same_access_flag)!=0; if(!success) { boost::throw_exception(thread_resource_error()); @@ -247,15 +247,15 @@ namespace boost inline void release_semaphore(handle semaphore,long count) { - BOOST_VERIFY(::boost::detail::winapi::ReleaseSemaphore(semaphore,count,0)!=0); + BOOST_VERIFY(::boost::winapi::ReleaseSemaphore(semaphore,count,0)!=0); } inline void get_system_info(system_info *info) { #if BOOST_PLAT_WINDOWS_RUNTIME - ::boost::detail::winapi::GetNativeSystemInfo(info); + ::boost::winapi::GetNativeSystemInfo(info); #else - ::boost::detail::winapi::GetSystemInfo(info); + ::boost::winapi::GetSystemInfo(info); #endif } @@ -266,15 +266,15 @@ namespace boost #if BOOST_PLAT_WINDOWS_RUNTIME std::this_thread::yield(); #else - ::boost::detail::winapi::Sleep(0); + ::boost::winapi::Sleep(0); #endif } else { #if BOOST_PLAT_WINDOWS_RUNTIME - ::boost::detail::winapi::WaitForSingleObjectEx(::boost::detail::winapi::GetCurrentThread(), milliseconds, 0); + ::boost::winapi::WaitForSingleObjectEx(::boost::winapi::GetCurrentThread(), milliseconds, 0); #else - ::boost::detail::winapi::Sleep(milliseconds); + ::boost::winapi::Sleep(milliseconds); #endif } } @@ -290,7 +290,7 @@ namespace boost { if (m_completionHandle != ::boost::detail::win32::invalid_handle_value) { - ::boost::detail::winapi::CloseHandle(m_completionHandle); + ::boost::winapi::CloseHandle(m_completionHandle); } } @@ -318,7 +318,7 @@ namespace boost { if(handle_to_manage && handle_to_manage!=invalid_handle_value) { - BOOST_VERIFY(::boost::detail::winapi::CloseHandle(handle_to_manage)); + BOOST_VERIFY(::boost::winapi::CloseHandle(handle_to_manage)); } } diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 52522213..7ec81447 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -7,7 +7,7 @@ //#define BOOST_THREAD_VERSION 3 -#include +#include #include #include #include @@ -498,7 +498,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::winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0); + return local_thread_info.get() && (winapi::WaitForSingleObjectEx(local_thread_info->interruption_handle,0,0)==0); } #endif @@ -726,7 +726,7 @@ namespace boost if(handle_count) { - unsigned long const notified_index=detail::winapi::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); + unsigned long const notified_index=winapi::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); if(notified_indexinterruption_handle); + winapi::ResetEvent(detail::get_current_thread_data()->interruption_handle); throw thread_interrupted(); } #endif @@ -810,7 +810,7 @@ namespace boost if(handle_count) { - unsigned long const notified_index=detail::winapi::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); + unsigned long const notified_index=winapi::WaitForMultipleObjectsEx(handle_count,handles,false,using_timer?INFINITE:time_left.milliseconds, 0); if(notified_indexid; } #endif - return detail::winapi::GetCurrentThreadId(); + return winapi::GetCurrentThreadId(); #else return thread::id(get_or_make_current_thread_data()); #endif @@ -858,7 +858,7 @@ namespace boost { if(interruption_enabled() && interruption_requested()) { - detail::winapi::ResetEvent(detail::get_current_thread_data()->interruption_handle); + winapi::ResetEvent(detail::get_current_thread_data()->interruption_handle); throw thread_interrupted(); } } @@ -870,7 +870,7 @@ namespace boost bool interruption_requested() BOOST_NOEXCEPT { - return detail::get_current_thread_data() && (detail::winapi::WaitForSingleObjectEx(detail::get_current_thread_data()->interruption_handle,0,0)==0); + return detail::get_current_thread_data() && (winapi::WaitForSingleObjectEx(detail::get_current_thread_data()->interruption_handle,0,0)==0); } #endif diff --git a/src/win32/tss_dll.cpp b/src/win32/tss_dll.cpp index cd71933c..75ea93a5 100644 --- a/src/win32/tss_dll.cpp +++ b/src/win32/tss_dll.cpp @@ -3,7 +3,7 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include #include diff --git a/src/win32/tss_pe.cpp b/src/win32/tss_pe.cpp index a5d258cd..e4a0a3aa 100644 --- a/src/win32/tss_pe.cpp +++ b/src/win32/tss_pe.cpp @@ -7,7 +7,7 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -#include +#include #include #if defined(BOOST_HAS_WINTHREADS) && defined(BOOST_THREAD_BUILD_LIB)