summaryrefslogtreecommitdiff
path: root/boost/interprocess/detail/os_thread_functions.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/interprocess/detail/os_thread_functions.hpp')
-rw-r--r--boost/interprocess/detail/os_thread_functions.hpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/boost/interprocess/detail/os_thread_functions.hpp b/boost/interprocess/detail/os_thread_functions.hpp
index 8469862cc9..3ff0a402ba 100644
--- a/boost/interprocess/detail/os_thread_functions.hpp
+++ b/boost/interprocess/detail/os_thread_functions.hpp
@@ -77,7 +77,19 @@ namespace ipcdetail{
typedef unsigned long OS_process_id_t;
typedef unsigned long OS_thread_id_t;
-typedef void* OS_thread_t;
+struct OS_thread_t
+{
+ OS_thread_t()
+ : m_handle()
+ {}
+
+
+ void* handle() const
+ { return m_handle; }
+
+ void* m_handle;
+};
+
typedef OS_thread_id_t OS_systemwide_thread_id_t;
//process
@@ -495,18 +507,21 @@ inline int thread_create( OS_thread_t * thread, unsigned (__stdcall * start_rout
void* h = (void*)_beginthreadex( 0, 0, start_routine, arg, 0, 0 );
if( h != 0 ){
- *thread = h;
+ thread->m_handle = h;
return 0;
}
else{
return 1;
}
+
+ thread->m_handle = (void*)_beginthreadex( 0, 0, start_routine, arg, 0, 0 );
+ return thread->m_handle != 0;
}
inline void thread_join( OS_thread_t thread)
{
- winapi::wait_for_single_object( thread, winapi::infinite_time );
- winapi::close_handle( thread );
+ winapi::wait_for_single_object( thread.handle(), winapi::infinite_time );
+ winapi::close_handle( thread.handle() );
}
#endif