From: wolf Date: Fri, 28 Jan 2000 13:00:14 +0000 (+0000) Subject: Add the possibility to call void functions (instead of void*) for Fun_Data[45]. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd69cce50deb091d5de518325803dfa01aacc3b0;p=dealii-svn.git Add the possibility to call void functions (instead of void*) for Fun_Data[45]. git-svn-id: https://svn.dealii.org/trunk@2276 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/thread_manager.h b/deal.II/base/include/base/thread_manager.h index fdc8a601ba..90006010da 100644 --- a/deal.II/base/include/base/thread_manager.h +++ b/deal.II/base/include/base/thread_manager.h @@ -964,11 +964,14 @@ class ThreadManager : public ACE_Thread_Manager struct Fun_Data4 { typedef void * (*FunPtr) (Arg1 , Arg2, Arg3, Arg4); - Arg1 arg1; - Arg2 arg2; - Arg3 arg3; - Arg4 arg4; - FunPtr fun_ptr; + typedef void (*VoidFunPtr) (Arg1 , Arg2, Arg3, Arg4); + + Arg1 arg1; + Arg2 arg2; + Arg3 arg3; + Arg4 arg4; + FunPtr fun_ptr; + VoidFunPtr void_fun_ptr; Fun_Data4 (Arg1 arg1, Arg2 arg2, @@ -979,7 +982,19 @@ class ThreadManager : public ACE_Thread_Manager arg2 (arg2), arg3 (arg3), arg4 (arg4), - fun_ptr (fun_ptr) {}; + fun_ptr (fun_ptr), + void_fun_ptr (0) {}; + Fun_Data4 (Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + VoidFunPtr void_fun_ptr) : + arg1 (arg1), + arg2 (arg2), + arg3 (arg3), + arg4 (arg4), + fun_ptr (0), + void_fun_ptr (void_fun_ptr) {}; }; /** @@ -998,12 +1013,15 @@ class ThreadManager : public ACE_Thread_Manager struct Fun_Data5 { typedef void * (*FunPtr) (Arg1 , Arg2, Arg3, Arg4, Arg5); - Arg1 arg1; - Arg2 arg2; - Arg3 arg3; - Arg4 arg4; - Arg5 arg5; - FunPtr fun_ptr; + typedef void (*VoidFunPtr) (Arg1 , Arg2, Arg3, Arg4, Arg5); + + Arg1 arg1; + Arg2 arg2; + Arg3 arg3; + Arg4 arg4; + Arg5 arg5; + FunPtr fun_ptr; + VoidFunPtr void_fun_ptr; Fun_Data5 (Arg1 arg1, Arg2 arg2, @@ -1016,8 +1034,22 @@ class ThreadManager : public ACE_Thread_Manager arg3 (arg3), arg4 (arg4), arg5 (arg5), - fun_ptr (fun_ptr) {}; - }; + fun_ptr (fun_ptr), + void_fun_ptr (0) {}; + Fun_Data5 (Arg1 arg1, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4, + Arg5 arg5, + VoidFunPtr void_fun_ptr) : + arg1 (arg1), + arg2 (arg2), + arg3 (arg3), + arg4 (arg4), + arg5 (arg5), + fun_ptr (0), + void_fun_ptr (void_fun_ptr) {}; + }; /** * This class is used to package @@ -3742,10 +3774,19 @@ void * ThreadManager::thread_entry_point_4 (void *_arg) // extract function pointer, object // and argument and dispatch the // call - return (arg->fun_ptr)(arg->arg1, - arg->arg2, - arg->arg3, - arg->arg4); + if (arg->fun_ptr != 0) + return (arg->fun_ptr)(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4); + else + { + (arg->void_fun_ptr)(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4); + return 0; + }; }; @@ -3764,14 +3805,25 @@ void * ThreadManager::thread_entry_point_5 (void *_arg) // extract function pointer, object // and argument and dispatch the // call - return (arg->fun_ptr)(arg->arg1, - arg->arg2, - arg->arg3, - arg->arg4, - arg->arg5); + if (arg->fun_ptr != 0) + return (arg->fun_ptr)(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4, + arg->arg5); + else + { + (arg->void_fun_ptr)(arg->arg1, + arg->arg2, + arg->arg3, + arg->arg4, + arg->arg5); + return 0; + }; }; + template