21 #include "../../../core/exception.hpp"
22 #include "../../../core/thread_base.hpp"
26 using namespace libjmmcg;
30 template<>
__declspec(dllexport) ppd::private_::thread_base<ppd::generic_traits::MS_Win32, ppd::sequential_mode>::thread_traits::api_params_type::core_work_fn_ret_t
__stdcall
31 ppd::private_::thread_base<ppd::generic_traits::MS_Win32, ppd::sequential_mode>
32 ::core_work_fn(thread_traits::api_params_type::core_work_fn_arg_t ptr) {
34 thread_base<generic_traits::MS_Win32, sequential_mode> *
const pthis=
reinterpret_cast<thread_base<generic_traits::MS_Win32,sequential_mode> *>(ptr);
38 const api_threading_traits<generic_traits::MS_Win32, sequential_mode>::api_params_type::states ret=pthis->process_chk();
39 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(ret);
40 }
catch (
const os_traits::thread_exception::value_type &e) {
41 assert(!
"JMMCG-exception caught.");
42 pthis->exception_thrown_in_thread.set(os_traits::thread_exception::value_type(StringToTString(e.what()), info::function(__LINE__,
__PRETTY_FUNCTION__,
typeid(core_work_fn), info::function::argument(
_T(
"void *"), tostring(ptr))),
JMMCG_REVISION_HDR(
_T(
LIBJMMCG_VERSION_NUMBER))));
43 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, sequential_mode>::api_params_type::jmmcg_exception);
44 }
catch (
const std::exception &e) {
45 assert(!
"STL-exception caught.");
46 pthis->exception_thrown_in_thread.set(os_traits::thread_exception::value_type(StringToTString(e.what()), info::function(__LINE__,
__PRETTY_FUNCTION__,
typeid(core_work_fn), info::function::argument(
_T(
"void *"), tostring(ptr))),
JMMCG_REVISION_HDR(
_T(
LIBJMMCG_VERSION_NUMBER))));
47 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, sequential_mode>::api_params_type::stl_exception);
49 assert(!
"Unknown exception caught.");
50 pthis->exception_thrown_in_thread.set(os_traits::thread_exception::value_type(
_T(
"Unknown exception caught."), info::function(__LINE__,
__PRETTY_FUNCTION__,
typeid(core_work_fn), info::function::argument(
_T(
"void *"), tostring(ptr))),
JMMCG_REVISION_HDR(
_T(
LIBJMMCG_VERSION_NUMBER))));
52 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, sequential_mode>::api_params_type::unknown_exception);
58 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, sequential_mode>::api_params_type::null_this_pointer);
61 template<>
__declspec(dllexport) ppd::private_::thread_base<ppd::generic_traits::MS_Win32, ppd::heavyweight_threading>::thread_traits::api_params_type::core_work_fn_ret_t
__stdcall
62 ppd::private_::thread_base<ppd::generic_traits::MS_Win32, ppd::heavyweight_threading>::core_work_fn(thread_traits::api_params_type::core_work_fn_arg_t ptr) {
64 thread_base<generic_traits::MS_Win32,heavyweight_threading> *
const pthis=
reinterpret_cast<thread_base<generic_traits::MS_Win32, heavyweight_threading> *>(ptr);
68 const api_threading_traits<generic_traits::MS_Win32, heavyweight_threading>::api_params_type::states ret=pthis->process_chk();
69 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(ret);
70 }
catch (
const os_traits::thread_exception::value_type &e) {
71 JMMCG_TRACE(_T(
"JMMCG-exception caught: ")<<e.what());
72 assert(!
"JMMCG-exception caught.");
73 pthis->exception_thrown_in_thread.set(os_traits::thread_exception::value_type(StringToTString(e.what()), info::function(__LINE__,
__PRETTY_FUNCTION__,
typeid(core_work_fn), info::function::argument(
_T(
"void *"), tostring(ptr))),
JMMCG_REVISION_HDR(
_T(
LIBJMMCG_VERSION_NUMBER))));
74 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, heavyweight_threading>::api_params_type::jmmcg_exception);
75 }
catch (
const std::exception &e) {
76 JMMCG_TRACE(_T(
"STL-exception caught: ")<<e.what());
77 assert(!
"STL-exception caught.");
78 pthis->exception_thrown_in_thread.set(os_traits::thread_exception::value_type(StringToTString(e.what()), info::function(__LINE__,
__PRETTY_FUNCTION__,
typeid(core_work_fn), info::function::argument(
_T(
"void *"), tostring(ptr))),
JMMCG_REVISION_HDR(
_T(
LIBJMMCG_VERSION_NUMBER))));
79 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, heavyweight_threading>::api_params_type::stl_exception);
82 pthis->exception_thrown_in_thread.set(os_traits::thread_exception::value_type(
_T(
"Unknown exception caught."), info::function(__LINE__,
__PRETTY_FUNCTION__,
typeid(core_work_fn), info::function::argument(
_T(
"void *"), tostring(ptr))),
JMMCG_REVISION_HDR(
_T(
LIBJMMCG_VERSION_NUMBER))));
84 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, heavyweight_threading>::api_params_type::unknown_exception);
90 return static_cast<thread_traits::api_params_type::core_work_fn_ret_t>(api_threading_traits<generic_traits::MS_Win32, heavyweight_threading>::api_params_type::null_this_pointer);