#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>
#include <boost/interprocess/streams/bufferstream.hpp>
-#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <cstddef>
#include <ostream>
#if defined(BOOST_INTERPROCESS_WINDOWS)
# include <boost/interprocess/detail/win32_api.hpp>
-# include <process.h>
+# include <boost/winapi/thread.hpp>
#else
# include <pthread.h>
# include <unistd.h>
if(!winapi::query_performance_counter(&count)){
count = winapi::get_tick_count();
}
- return count;
+ return (OS_highres_count_t)count;
}
inline void zero_highres_count(OS_highres_count_t &count)
struct timespec rqt;
//Sleep for the half of the tick time
rqt.tv_sec = 0;
- rqt.tv_nsec = get_system_tick_ns()/2;
+ rqt.tv_nsec = (long)get_system_tick_ns()/2;
::nanosleep(&rqt, 0);
}
#if defined(BOOST_INTERPROCESS_WINDOWS)
-inline int thread_create( OS_thread_t * thread, unsigned (__stdcall * start_routine) (void*), void* arg )
+inline int thread_create( OS_thread_t * thread, boost::ipwinapiext::LPTHREAD_START_ROUTINE_ start_routine, void* arg )
{
- void* h = (void*)_beginthreadex( 0, 0, start_routine, arg, 0, 0 );
+ void* h = boost::ipwinapiext::CreateThread(0, 0, start_routine, arg, 0, 0);
if( h != 0 ){
thread->m_handle = h;
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)
#if defined(BOOST_INTERPROCESS_WINDOWS)
-inline unsigned __stdcall launch_thread_routine( void * pv )
+inline boost::winapi::DWORD_ __stdcall launch_thread_routine(boost::winapi::LPVOID_ pv)
{
os_thread_func_ptr_deleter<abstract_thread> pt( static_cast<abstract_thread *>( pv ) );
pt->run();
: f_( f )
{}
- void run()
+ virtual void run() BOOST_OVERRIDE
{ f_(); }
private: