OSDN Git Service

再び呼び出しが可能です
authormyun2 <myun2@nwhite.info>
Sun, 9 Sep 2012 11:37:04 +0000 (20:37 +0900)
committermyun2 <myun2@nwhite.info>
Sun, 9 Sep 2012 11:37:41 +0000 (20:37 +0900)
なんでio_exception 使ってるん

roast/include/roast/parallel/thread/thread.hpp

index 07d64e1..8eddbc4 100644 (file)
@@ -19,17 +19,17 @@ namespace roast
        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:
@@ -37,7 +37,7 @@ namespace roast
                        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.");
@@ -74,7 +74,7 @@ namespace roast
 
                ////////////////////////////////////////////////////////
                
-               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);
                }
@@ -115,7 +115,7 @@ namespace roast
 
                ////////////////////////////////////////////////////////
 
-               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 )
@@ -127,7 +127,7 @@ namespace roast
                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