}
template <typename T>
- thread_(T *ptr, roast_thread_func_t func, int param=0, void* opt=NULL)
+ thread_(int (T::*func)(int), T *ptr, int param=0, void* opt=NULL)
{
- if ( start_class_ptr(ptr,func,param,opt) != true )
+ if ( start_class_ptr(func,ptr,param,opt) != true )
thread_exception("thread start failed.");
}
+
+ template <typename T>
+ thread_(int (T::*func)(int), int param=0, void* opt=NULL)
+ {
+ // The second parameter is a class pointer or the method should be static.
+ The_second_parameter_is_a_class_pointer_or_the_method_should_be_static.
+ }
virtual ~thread_()
{
}
template <typename T>
- bool start_class_ptr(T *ptr, roast_thread_func_t func, int param=0, void* opt=NULL)
+ bool start_class_ptr(int (T::*func)(int), int param=0, void* opt=NULL)
+ {
+ // The second parameter is a class pointer or the method should be static.
+ The_second_parameter_is_a_class_pointer_or_the_method_should_be_static.
+ }
+
+ template <typename T>
+ bool start_class_ptr(int (T::*func)(int), T *ptr, int param=0, void* opt=NULL)
{
m_handle = m_impl.start(
- _thread_classptr_internal_callback<T>,
+ _thread_class_internal_callback<T>,
(int)new _thread_start_class_info<T>(ptr, func, param, false),
opt);
if ( m_handle == NULL )