class thread_
{
public:
- typedef int (*callback_func_t)(int);
+ typedef void* (*callback_func_t)(void*);
typedef typename _Impl::handle_type handle_t;
protected:
_Impl m_impl;
- thread_handle_t m_handle;
+ handle_t m_handle;
// Assert
void handle_assert(const char* method_name){
if ( m_handle == _Impl::invalid_handle )
- throw io_exception(::std::string(method_name) + "(): Handler is Invalid.");
+ throw thread_exception(::std::string(method_name) + "(): Handler is Invalid.");
}
public:
m_handle = _Impl::invalid_handle;
}
- /*thread_(thread_func_t func, int param=0, void* opt=NULL)
+ /*thread_(callback_func_t func, int param=0, void* opt=NULL)
{
if ( start(func,param,opt) != true )
thread_exception("thread start failed.");
////////////////////////////////////////////////////////
- bool start(thread_func_t func, void* param=NULL, void* opt=NULL)
+ bool start(callback_func_t func, void* param=NULL, void* opt=NULL)
{
return start_func(func,param,opt);
}
////////////////////////////////////////////////////////
- bool start_func(thread_func_t func, int param=0, void* opt=NULL)
+ bool start_func(callback_func_t func, int param=0, void* opt=NULL)
{
m_handle = m_impl.start(func,param,opt);
if ( m_handle == _Impl::invalid_handle )
template <typename _Param, typename _Ret>
bool start_func(_Ret (*func)(_Param), _Param param=0, void* opt=NULL)
{
- m_handle = m_impl.start((thread_func_t)func,(void*)param,opt);
+ m_handle = m_impl.start((callback_func_t)func,(void*)param,opt);
if ( m_handle == _Impl::invalid_handle )
return false;
else