29 #ifndef RCF_DETAIL_WIN_THREAD_HPP
30 #define RCF_DETAIL_WIN_THREAD_HPP
32 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
34 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
36 #if defined(BOOST_WINDOWS) && !defined(UNDER_CE)
38 #include <RCF/thread/push_options.hpp>
43 RCF_EXPORT
unsigned int __stdcall win_thread_function(
void* arg);
48 func_base() : entry_event_(0), exit_event_(0)
55 ::CloseHandle(entry_event_);
60 ::CloseHandle(exit_event_);
65 virtual void run() = 0;
67 ::HANDLE entry_event_;
71 template <
typename Function>
90 class RCF_EXPORT win_thread
95 template <
typename Function>
96 win_thread(Function f,
unsigned int stack_size = 0)
99 mArgPtr.reset(
new func<Function>(f));
100 start_thread(stack_size);
110 friend RCF_EXPORT
unsigned int __stdcall win_thread_function(
void* arg);
112 void start_thread(
unsigned int stack_size);
116 boost::shared_ptr<func_base> mArgPtr;
122 #include <RCF/thread/pop_options.hpp>
124 #endif // defined(BOOST_WINDOWS) && !defined(UNDER_CE)
126 #endif // RCF_DETAIL_WIN_THREAD_HPP