From c9e1dc4b750f0bf2266b75612e5ab0e8705ca73e Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Tue, 2 Jul 2002 19:59:51 +0000 Subject: ChangeLogTag:Tue Jul 2 11:53:29 2002 Steve Huston --- ChangeLog | 64 ++++++++++++++++++++++ ChangeLogs/ChangeLog-02a | 64 ++++++++++++++++++++++ ChangeLogs/ChangeLog-03a | 64 ++++++++++++++++++++++ ace/Base_Thread_Adapter.cpp | 4 +- ace/Base_Thread_Adapter.h | 18 +++--- ace/Event_Handler.cpp | 2 +- ace/Event_Handler.h | 2 +- ace/OS.cpp | 6 +- ace/OS.h | 25 ++------- ace/OS.i | 10 ++-- ace/OS_Thread_Adapter.cpp | 13 ++--- ace/OS_Thread_Adapter.h | 20 +++---- ace/Task.cpp | 9 +-- ace/Task.h | 2 +- ace/Thread.h | 6 +- ace/Thread.i | 6 +- ace/Thread_Adapter.cpp | 16 ++---- ace/Thread_Adapter.h | 18 +++--- ace/Thread_Control.cpp | 4 +- ace/Thread_Control.h | 20 +++---- ace/Thread_Control.inl | 6 +- ace/Thread_Hook.cpp | 2 +- ace/Thread_Hook.h | 6 +- ace/Thread_Manager.cpp | 6 +- ace/Thread_Manager.h | 15 +++-- ace/config-all.h | 37 ++++++++++++- .../RT_Thread_Per_Connection_Logging_Server.cpp | 2 +- .../Thread_Per_Connection_Logging_Server.cpp | 2 +- .../C++NPv1/Thread_Per_Connection_Logging_Server.h | 2 +- examples/C++NPv2/AC_Client_Logging_Daemon.cpp | 2 +- examples/C++NPv2/Client_Logging_Daemon.cpp | 8 +-- .../C++NPv2/Reactor_Logging_Server_Adapter.cpp | 4 +- examples/C++NPv2/Select_Reactor_Logging_Server.cpp | 4 +- examples/C++NPv2/Server_Shutdown.cpp | 2 +- examples/C++NPv2/TP_Logging_Server.cpp | 4 +- examples/C++NPv2/TP_Logging_Server.h | 4 +- examples/C++NPv2/TP_Reactor_Logging_Server.cpp | 4 +- examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp | 2 +- examples/C++NPv2/display_logfile.cpp | 6 +- examples/Connection/blocking/SPIPE-acceptor.cpp | 2 +- examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp | 4 +- examples/IPC_SAP/SSL_SAP/SSL-server.cpp | 4 +- examples/Reactor/WFMO_Reactor/Abandoned.cpp | 2 +- performance-tests/TCP/tcp_test.cpp | 2 +- tests/ACE_Init_Test.cpp | 4 +- tests/MEM_Stream_Test.cpp | 2 +- tests/Service_Config_DLL.cpp | 2 +- tests/Task_Test.cpp | 6 +- tests/Thread_Pool_Reactor_Resume_Test.cpp | 6 +- tests/Thread_Pool_Reactor_Test.cpp | 6 +- 50 files changed, 369 insertions(+), 162 deletions(-) diff --git a/ChangeLog b/ChangeLog index 153928b61fa..08f63756ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,66 @@ +Tue Jul 2 11:53:29 2002 Steve Huston + + * ace/config-all.h: Changed definition of ACE_THR_FUNC to incorporate + the platform's thread function return type (DWORD on Windows, + void * on most others). Uses a new typedef ACE_THR_FUNC_RETURN + to specify the platform's thread function return type. + + * ace/OS.{h i cpp} (thr_exit, thr_join): The status arg is now + a ACE_THR_FUNC_RETURN *. + Also moved remaining thread function definition type things to + config-all.h with the rest of them. + + * ace/Base_Thread_Adapter.{h cpp} (invoke(), ace_thread_adapter()): + * ace/OS_Thread_Adapter.{h cpp} + * ace/Thread_Adapter.{h cpp} (invoke(), invoke_i()): + Return type changed from void * to ACE_THR_FUNC_RETURN. + + * ace/Event_Handler.{cpp h} (read_adapter): Change return value from + void* to ACE_THR_FUNC_RETURN. + + * ace/Thread_Hook.{h cpp}: ACE_Thread_Hook::start () returns + ACE_THR_FUNC_RETURN, not void *. + + * ace/Thread.{h i} (exit, join): 'status' arg is now + ACE_THR_FUNC_RETURN *, not void *. + + * ace/Thread_Control.{h inl cpp} (status, exit): + * ace/Thread_Manager.{h cpp} (exit, join): Thread exit status + type changed from void * to ACE_THR_FUNC_RETURN. + + * ace/Task.{h cpp} (ACE_Task_Base): Return type from svc_run now + ACE_THR_FUNC_RETURN. + + * examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp: + * examples/C++NPv1/Thread_Per_Connection_Logging_Server.{cpp, h}: + * examples/C++NPv2/Select_Reactor_Logging_Server.cpp: + * examples/C++NPv2/Server_Shutdown.cpp: + * examples/C++NPv2/TP_Reactor_Logging_Server.cpp: + * examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp: + * examples/C++NPv2/Client_Logging_Daemon.cpp: + * examples/Connection/blocking/SPIPE-acceptor.cpp: + * examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp: + * examples/IPC_SAP/SSL_SAP/SSL-server.cpp: + * examples/Reactor/WFMO_Reactor/Abandoned.cpp: + * performance-tests/TCP/tcp_test.cpp: + * tests/ACE_Init_Test.cpp: + * tests/MEM_Stream_Test.cpp: + * tests/Service_Config_DLL.cpp: + * tests/Task_Test.cpp: + * tests/Thread_Pool_Reactor_Resume_Test.cpp: + * tests/Thread_Pool_Reactor_Test.cpp: + Change thread function to return ACE_THR_FUNC_RETURN, not void *. + + * examples/C++NPv2/TP_Logging_Server.cpp (handle_input, svc): + * examples/C++NPv2/AC_Client_Logging_Daemon.cpp (open): + * examples/C++NPv2/display_logfile.cpp (svc): Change + ACE_reinterpret_cast to ACE_static_cast. Thanks to Doug Schmidt + for finding this. + + * examples/C++NPv2/TP_Logging_Server.h: + * examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp: Corrected use + of ACE_NEW_RETURN. + Mon Jul 1 23:16:47 2002 Jeff Parsons * */Makefile: @@ -96,6 +159,7 @@ Sun Jun 30 12:22:12 2002 Johnny Willemsen Updated these files so that the new PortableGroup doxygen documentation is generated and listed in the index page. +>>>>>>> 4.3830 Fri Jun 28 08:07:12 2002 Douglas C. Schmidt * ace/Logging_Strategy.cpp: Added the ability to toggle diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a index 153928b61fa..08f63756ddb 100644 --- a/ChangeLogs/ChangeLog-02a +++ b/ChangeLogs/ChangeLog-02a @@ -1,3 +1,66 @@ +Tue Jul 2 11:53:29 2002 Steve Huston + + * ace/config-all.h: Changed definition of ACE_THR_FUNC to incorporate + the platform's thread function return type (DWORD on Windows, + void * on most others). Uses a new typedef ACE_THR_FUNC_RETURN + to specify the platform's thread function return type. + + * ace/OS.{h i cpp} (thr_exit, thr_join): The status arg is now + a ACE_THR_FUNC_RETURN *. + Also moved remaining thread function definition type things to + config-all.h with the rest of them. + + * ace/Base_Thread_Adapter.{h cpp} (invoke(), ace_thread_adapter()): + * ace/OS_Thread_Adapter.{h cpp} + * ace/Thread_Adapter.{h cpp} (invoke(), invoke_i()): + Return type changed from void * to ACE_THR_FUNC_RETURN. + + * ace/Event_Handler.{cpp h} (read_adapter): Change return value from + void* to ACE_THR_FUNC_RETURN. + + * ace/Thread_Hook.{h cpp}: ACE_Thread_Hook::start () returns + ACE_THR_FUNC_RETURN, not void *. + + * ace/Thread.{h i} (exit, join): 'status' arg is now + ACE_THR_FUNC_RETURN *, not void *. + + * ace/Thread_Control.{h inl cpp} (status, exit): + * ace/Thread_Manager.{h cpp} (exit, join): Thread exit status + type changed from void * to ACE_THR_FUNC_RETURN. + + * ace/Task.{h cpp} (ACE_Task_Base): Return type from svc_run now + ACE_THR_FUNC_RETURN. + + * examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp: + * examples/C++NPv1/Thread_Per_Connection_Logging_Server.{cpp, h}: + * examples/C++NPv2/Select_Reactor_Logging_Server.cpp: + * examples/C++NPv2/Server_Shutdown.cpp: + * examples/C++NPv2/TP_Reactor_Logging_Server.cpp: + * examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp: + * examples/C++NPv2/Client_Logging_Daemon.cpp: + * examples/Connection/blocking/SPIPE-acceptor.cpp: + * examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp: + * examples/IPC_SAP/SSL_SAP/SSL-server.cpp: + * examples/Reactor/WFMO_Reactor/Abandoned.cpp: + * performance-tests/TCP/tcp_test.cpp: + * tests/ACE_Init_Test.cpp: + * tests/MEM_Stream_Test.cpp: + * tests/Service_Config_DLL.cpp: + * tests/Task_Test.cpp: + * tests/Thread_Pool_Reactor_Resume_Test.cpp: + * tests/Thread_Pool_Reactor_Test.cpp: + Change thread function to return ACE_THR_FUNC_RETURN, not void *. + + * examples/C++NPv2/TP_Logging_Server.cpp (handle_input, svc): + * examples/C++NPv2/AC_Client_Logging_Daemon.cpp (open): + * examples/C++NPv2/display_logfile.cpp (svc): Change + ACE_reinterpret_cast to ACE_static_cast. Thanks to Doug Schmidt + for finding this. + + * examples/C++NPv2/TP_Logging_Server.h: + * examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp: Corrected use + of ACE_NEW_RETURN. + Mon Jul 1 23:16:47 2002 Jeff Parsons * */Makefile: @@ -96,6 +159,7 @@ Sun Jun 30 12:22:12 2002 Johnny Willemsen Updated these files so that the new PortableGroup doxygen documentation is generated and listed in the index page. +>>>>>>> 4.3830 Fri Jun 28 08:07:12 2002 Douglas C. Schmidt * ace/Logging_Strategy.cpp: Added the ability to toggle diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 153928b61fa..08f63756ddb 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,66 @@ +Tue Jul 2 11:53:29 2002 Steve Huston + + * ace/config-all.h: Changed definition of ACE_THR_FUNC to incorporate + the platform's thread function return type (DWORD on Windows, + void * on most others). Uses a new typedef ACE_THR_FUNC_RETURN + to specify the platform's thread function return type. + + * ace/OS.{h i cpp} (thr_exit, thr_join): The status arg is now + a ACE_THR_FUNC_RETURN *. + Also moved remaining thread function definition type things to + config-all.h with the rest of them. + + * ace/Base_Thread_Adapter.{h cpp} (invoke(), ace_thread_adapter()): + * ace/OS_Thread_Adapter.{h cpp} + * ace/Thread_Adapter.{h cpp} (invoke(), invoke_i()): + Return type changed from void * to ACE_THR_FUNC_RETURN. + + * ace/Event_Handler.{cpp h} (read_adapter): Change return value from + void* to ACE_THR_FUNC_RETURN. + + * ace/Thread_Hook.{h cpp}: ACE_Thread_Hook::start () returns + ACE_THR_FUNC_RETURN, not void *. + + * ace/Thread.{h i} (exit, join): 'status' arg is now + ACE_THR_FUNC_RETURN *, not void *. + + * ace/Thread_Control.{h inl cpp} (status, exit): + * ace/Thread_Manager.{h cpp} (exit, join): Thread exit status + type changed from void * to ACE_THR_FUNC_RETURN. + + * ace/Task.{h cpp} (ACE_Task_Base): Return type from svc_run now + ACE_THR_FUNC_RETURN. + + * examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp: + * examples/C++NPv1/Thread_Per_Connection_Logging_Server.{cpp, h}: + * examples/C++NPv2/Select_Reactor_Logging_Server.cpp: + * examples/C++NPv2/Server_Shutdown.cpp: + * examples/C++NPv2/TP_Reactor_Logging_Server.cpp: + * examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp: + * examples/C++NPv2/Client_Logging_Daemon.cpp: + * examples/Connection/blocking/SPIPE-acceptor.cpp: + * examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp: + * examples/IPC_SAP/SSL_SAP/SSL-server.cpp: + * examples/Reactor/WFMO_Reactor/Abandoned.cpp: + * performance-tests/TCP/tcp_test.cpp: + * tests/ACE_Init_Test.cpp: + * tests/MEM_Stream_Test.cpp: + * tests/Service_Config_DLL.cpp: + * tests/Task_Test.cpp: + * tests/Thread_Pool_Reactor_Resume_Test.cpp: + * tests/Thread_Pool_Reactor_Test.cpp: + Change thread function to return ACE_THR_FUNC_RETURN, not void *. + + * examples/C++NPv2/TP_Logging_Server.cpp (handle_input, svc): + * examples/C++NPv2/AC_Client_Logging_Daemon.cpp (open): + * examples/C++NPv2/display_logfile.cpp (svc): Change + ACE_reinterpret_cast to ACE_static_cast. Thanks to Doug Schmidt + for finding this. + + * examples/C++NPv2/TP_Logging_Server.h: + * examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp: Corrected use + of ACE_NEW_RETURN. + Mon Jul 1 23:16:47 2002 Jeff Parsons * */Makefile: @@ -96,6 +159,7 @@ Sun Jun 30 12:22:12 2002 Johnny Willemsen Updated these files so that the new PortableGroup doxygen documentation is generated and listed in the index page. +>>>>>>> 4.3830 Fri Jun 28 08:07:12 2002 Douglas C. Schmidt * ace/Logging_Strategy.cpp: Added the ability to toggle diff --git a/ace/Base_Thread_Adapter.cpp b/ace/Base_Thread_Adapter.cpp index b0ceffe5cd9..b2f1326cf00 100644 --- a/ace/Base_Thread_Adapter.cpp +++ b/ace/Base_Thread_Adapter.cpp @@ -101,7 +101,7 @@ ace_thread_adapter (unsigned long args) thread_args->invoke (); } #else /* ! defined (ACE_PSOS) */ -extern "C" void * +extern "C" ACE_THR_FUNC_RETURN ace_thread_adapter (void *args) { ACE_OS_TRACE ("ace_thread_adapter"); @@ -118,7 +118,7 @@ ace_thread_adapter (void *args) ACE_static_cast (ACE_Base_Thread_Adapter *, args); // Invoke the user-supplied function with the args. - void *status = thread_args->invoke (); + ACE_THR_FUNC_RETURN status = thread_args->invoke (); return status; } diff --git a/ace/Base_Thread_Adapter.h b/ace/Base_Thread_Adapter.h index 9d2e50d55e0..7661e061206 100644 --- a/ace/Base_Thread_Adapter.h +++ b/ace/Base_Thread_Adapter.h @@ -25,7 +25,7 @@ #if defined (ACE_PSOS) extern "C" void ace_thread_adapter (unsigned long args); #else /* ! defined (ACE_PSOS) */ -extern "C" ACE_OS_Export void *ace_thread_adapter (void *args); +extern "C" ACE_OS_Export ACE_THR_FUNC_RETURN ace_thread_adapter (void *args); #endif /* ACE_PSOS */ /** @@ -60,16 +60,16 @@ protected: * * @brief Base class for all the Thread_Adapters. * - * Converts a C++ function into a function - * function that can be called from a thread creation routine - * (e.g., or <_beginthreadex>) that expects an + * Converts a C++ function into a function that can be + * called from a thread creation routine + * (e.g., pthread_create() or _beginthreadex()) that expects an * extern "C" entry point. This class also makes it possible to * transparently provide hooks to register a thread with an - * . - * This class is used in . In general, the + * ACE_Thread_Manager. + * This class is used in ACE_OS::thr_create(). In general, the * thread that creates an object of this class is different from - * the thread that calls on this object. Therefore, - * the method is responsible for deleting itself. + * the thread that calls @c invoke() on this object. Therefore, + * the @c invoke() method is responsible for deleting itself. */ class ACE_OS_Export ACE_Base_Thread_Adapter { @@ -86,7 +86,7 @@ public: ); /// Virtual method invoked by the thread entry point. - virtual void *invoke (void) = 0; + virtual ACE_THR_FUNC_RETURN invoke (void) = 0; /// Accessor for the C entry point function to the OS thread creation /// routine. diff --git a/ace/Event_Handler.cpp b/ace/Event_Handler.cpp index ad71ab47f78..afc21d15522 100644 --- a/ace/Event_Handler.cpp +++ b/ace/Event_Handler.cpp @@ -183,7 +183,7 @@ ACE_Event_Handler::reactor (void) const // handler returns we default to reading from // ACE_STDIN. -void * +ACE_THR_FUNC_RETURN ACE_Event_Handler::read_adapter (void *args) { ACE_Event_Handler *this_ptr = (ACE_Event_Handler *) args; diff --git a/ace/Event_Handler.h b/ace/Event_Handler.h index 80bcfe69bda..470751fb860 100644 --- a/ace/Event_Handler.h +++ b/ace/Event_Handler.h @@ -168,7 +168,7 @@ public: * this event handler returns we default to * reading from ACE_STDIN. */ - static void *read_adapter (void *event_handler); + static ACE_THR_FUNC_RETURN read_adapter (void *event_handler); /** * Abstracts away from the differences between Win32 and ACE with diff --git a/ace/OS.cpp b/ace/OS.cpp index 3d9074365b6..9643d536fdf 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -3586,7 +3586,7 @@ ACE_OS::thr_create (ACE_THR_FUNC func, } void -ACE_OS::thr_exit (void *status) +ACE_OS::thr_exit (ACE_THR_FUNC_RETURN status) { ACE_OS_TRACE ("ACE_OS::thr_exit"); #if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) @@ -3622,7 +3622,7 @@ ACE_OS::thr_exit (void *status) if (using_afx != -1) { if (using_afx) - ::AfxEndThread ((DWORD)status); + ::AfxEndThread (status); else ACE_ENDTHREADEX (status); } @@ -3636,7 +3636,7 @@ ACE_OS::thr_exit (void *status) if (!pThread || pThread->m_nThreadID != ACE_OS::thr_self ()) ACE_ENDTHREADEX (status); else - ::AfxEndThread ((DWORD)status); + ::AfxEndThread (status); } # else ACE_ENDTHREADEX (status); diff --git a/ace/OS.h b/ace/OS.h index 9662a9aaacc..a3809b0b2e0 100644 --- a/ace/OS.h +++ b/ace/OS.h @@ -4080,21 +4080,6 @@ union semun typedef const char **SYS_SIGLIST; -// This is for C++ static methods. -# if defined (VXWORKS) -typedef int ACE_THR_FUNC_INTERNAL_RETURN_TYPE; -typedef FUNCPTR ACE_THR_FUNC_INTERNAL; // where typedef int (*FUNCPTR) (...) -# elif defined (ACE_PSOS) -typedef void (*ACE_THR_FUNC_INTERNAL)(void *); -# else -typedef ACE_THR_FUNC ACE_THR_FUNC_INTERNAL; -# endif /* VXWORKS */ - -extern "C" { -typedef void (*ACE_THR_C_DEST)(void *); -} -typedef void (*ACE_THR_DEST)(void *); - # if !defined (MAP_FAILED) || defined (ACE_HAS_BROKEN_MAP_FAILED) # undef MAP_FAILED # define MAP_FAILED ((void *) -1) @@ -5782,7 +5767,7 @@ public: int &prio, int *policy = 0); static int thr_join (ACE_Thread_ID waiter_id, - void **status); + ACE_THR_FUNC_RETURN *status); static int thr_kill (ACE_Thread_ID thr_id, int signum); static ACE_Thread_ID thr_self (void); @@ -5843,10 +5828,10 @@ public: static int thr_getprio (ACE_hthread_t thr_id, int &prio); static int thr_join (ACE_hthread_t waiter_id, - void **status); + ACE_THR_FUNC_RETURN *status); static int thr_join (ACE_thread_t waiter_id, ACE_thread_t *thr_id, - void **status); + ACE_THR_FUNC_RETURN *status); static int thr_kill (ACE_thread_t thr_id, int signum); static ACE_thread_t thr_self (void); @@ -5861,7 +5846,7 @@ public: ACE_hthread_t t2); static int thr_equal (ACE_thread_t t1, ACE_thread_t t2); - static void thr_exit (void *status = 0); + static void thr_exit (ACE_THR_FUNC_RETURN status = 0); static int thr_getconcurrency (void); static int lwp_getparams (ACE_Sched_Params &); # if defined (ACE_HAS_TSS_EMULATION) && defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) @@ -6412,7 +6397,7 @@ public: * NOTE: tss_open () is called by ACE for threads that it spawns. * If your application spawns threads without using ACE, and it uses * ACE's TSS emulation, each of those threads should call tss_open - * (). See the ace_thread_adapter () implementaiton for an example. + * (). See the ace_thread_adapter () implementation for an example. */ static void *tss_open (void *ts_storage[ACE_TSS_THREAD_KEYS_MAX]); diff --git a/ace/OS.i b/ace/OS.i index f76e8719a0b..5ce1650ba98 100644 --- a/ace/OS.i +++ b/ace/OS.i @@ -6874,7 +6874,7 @@ ACE_OS::thr_getspecific (ACE_thread_key_t key, void **data) ACE_INLINE int ACE_OS::thr_join (ACE_hthread_t thr_handle, - void **status) + ACE_THR_FUNC_RETURN *status) { ACE_OS_TRACE ("ACE_OS::thr_join"); #if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) @@ -6918,14 +6918,14 @@ ACE_OS::thr_join (ACE_hthread_t thr_handle, int, -1); # endif /* ACE_HAS_PTHREADS_DRAFT4, 6 */ # elif defined (ACE_HAS_WTHREADS) - void *local_status = 0; + ACE_THR_FUNC_RETURN local_status = 0; // Make sure that status is non-NULL. if (status == 0) status = &local_status; if (::WaitForSingleObject (thr_handle, INFINITE) == WAIT_OBJECT_0 - && ::GetExitCodeThread (thr_handle, (LPDWORD) status) != FALSE) + && ::GetExitCodeThread (thr_handle, status) != FALSE) { ::CloseHandle (thr_handle); return 0; @@ -6951,7 +6951,7 @@ ACE_OS::thr_join (ACE_hthread_t thr_handle, ACE_INLINE int ACE_OS::thr_join (ACE_thread_t waiter_id, ACE_thread_t *thr_id, - void **status) + ACE_THR_FUNC_RETURN *status) { ACE_OS_TRACE ("ACE_OS::thr_join"); #if defined (ACE_HAS_PACE) && !defined (ACE_WIN32) @@ -10806,7 +10806,7 @@ ACE_OS::thr_getprio (const ACE_Thread_ID &thr_id, int &prio) } ACE_INLINE int -ACE_OS::thr_join (const ACE_Thread_ID &thr_id, void **status) +ACE_OS::thr_join (const ACE_Thread_ID &thr_id, ACE_THR_FUNC_RETURN *status) { # if defined (ACE_WIN32) return ACE_OS::thr_join (thr_id.handle (), status); diff --git a/ace/OS_Thread_Adapter.cpp b/ace/OS_Thread_Adapter.cpp index 572f070ab0b..0e59ad0926b 100644 --- a/ace/OS_Thread_Adapter.cpp +++ b/ace/OS_Thread_Adapter.cpp @@ -35,7 +35,7 @@ ACE_OS_Thread_Adapter::~ACE_OS_Thread_Adapter (void) { } -void * +ACE_THR_FUNC_RETURN ACE_OS_Thread_Adapter::invoke (void) { // Inherit the logging features if the parent thread has an @@ -68,7 +68,7 @@ ACE_OS_Thread_Adapter::invoke (void) #endif /* ACE_NEEDS_LWP_PRIO_SET */ - void *status = 0; + ACE_THR_FUNC_RETURN status = 0; ACE_SEH_TRY { @@ -88,14 +88,11 @@ ACE_OS_Thread_Adapter::invoke (void) // Call thread entry point. #if defined (ACE_PSOS) (*func) (arg); + status = 0; #else /* ! ACE_PSOS */ - status = ACE_reinterpret_cast (void *, (*func) (arg)); + status = (*func) (arg); #endif /* ACE_PSOS */ } -#if defined (ACE_PSOS) - // pSOS task functions do not return a value. - status = 0; -#endif /* ACE_PSOS */ } #if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) @@ -147,7 +144,7 @@ ACE_OS_Thread_Adapter::invoke (void) if (!pThread || pThread->m_nThreadID != ACE_OS::thr_self ()) ACE_ENDTHREADEX (status); else - ::AfxEndThread ((DWORD)status); + ::AfxEndThread (status); # else ACE_ENDTHREADEX (status); # endif /* ACE_HAS_MFC && ACE_HAS_MFS != 0*/ diff --git a/ace/OS_Thread_Adapter.h b/ace/OS_Thread_Adapter.h index 45b7a6971c3..57caf56a0c3 100644 --- a/ace/OS_Thread_Adapter.h +++ b/ace/OS_Thread_Adapter.h @@ -24,17 +24,17 @@ /** * @class ACE_OS_Thread_Adapter * - * @brief Converts a C++ function into a function - * function that can be called from a thread creation routine - * (e.g., or <_beginthreadex>) that expects an + * @brief Converts a C++ function into a function that can be + * called from a thread creation routine + * (e.g., pthread_create() or _beginthreadex()) that expects an * extern "C" entry point. This class also makes it possible to * transparently provide hooks to register a thread with an - * . + * ACE_Thread_Manager. * - * This class is used in . In general, the + * This class is used in ACE_OS::thr_create(). In general, the * thread that creates an object of this class is different from - * the thread that calls on this object. Therefore, - * the method is responsible for deleting itself. + * the thread that calls invoke() on this object. Therefore, + * the invoke() method is responsible for deleting itself. */ class ACE_OS_Export ACE_OS_Thread_Adapter : public ACE_Base_Thread_Adapter { @@ -50,11 +50,11 @@ public: ); /** - * Execute the with the . This function deletes - * , thereby rendering the object useless after the call + * Execute the @a user_func_ with the @a arg. This function deletes + * @c this, thereby rendering the object useless after the call * returns. */ - virtual void *invoke (void); + virtual ACE_THR_FUNC_RETURN invoke (void); private: /// Ensure that this object must be allocated on the heap. diff --git a/ace/Task.cpp b/ace/Task.cpp index b073c27eaed..a841b0295dd 100644 --- a/ace/Task.cpp +++ b/ace/Task.cpp @@ -107,7 +107,7 @@ ACE_Task_Base::activate (long flags, // Thread Ids were not specified grp_spawned = this->thr_mgr_->spawn_n (n_threads, - ACE_THR_FUNC (&ACE_Task_Base::svc_run), + &ACE_Task_Base::svc_run, (void *) this, flags, priority, @@ -121,7 +121,7 @@ ACE_Task_Base::activate (long flags, grp_spawned = this->thr_mgr_->spawn_n (thread_ids, n_threads, - ACE_THR_FUNC (&ACE_Task_Base::svc_run), + &ACE_Task_Base::svc_run, (void *) this, flags, priority, @@ -182,7 +182,7 @@ ACE_Task_Base_cleanup (void *object, void *) } #endif /* ACE_HAS_SIG_C_FUNC */ -void * +ACE_THR_FUNC_RETURN ACE_Task_Base::svc_run (void *args) { ACE_TRACE ("ACE_Task_Base::svc_run"); @@ -200,7 +200,8 @@ ACE_Task_Base::svc_run (void *args) #endif /* ACE_HAS_SIG_C_FUNC */ // Call the Task's svc() hook method. - void * status = ACE_reinterpret_cast(void *, t->svc ()); + ACE_THR_FUNC_RETURN status = + ACE_reinterpret_cast(ACE_THR_FUNC_RETURN, t->svc ()); // If we changed this zero change the other if in OS.cpp Thread_Adapter::invoke #if 1 diff --git a/ace/Task.h b/ace/Task.h index eb45b99806b..7686378388a 100644 --- a/ace/Task.h +++ b/ace/Task.h @@ -227,7 +227,7 @@ public: void thr_count_dec (void); /// Routine that runs the service routine as a daemon thread. - static void *svc_run (void *); + static ACE_THR_FUNC_RETURN svc_run (void *); /// Cleanup hook that is called when a thread exits to gracefully /// shutdown an . diff --git a/ace/Thread.h b/ace/Thread.h index 61ee5715463..f7170ca8f6f 100644 --- a/ace/Thread.h +++ b/ace/Thread.h @@ -134,11 +134,11 @@ public: /// Wait for one or more threads to exit and reap their exit status. static int join (ACE_thread_t, ACE_thread_t *, - void **status); + ACE_THR_FUNC_RETURN *status); /// Wait for one thread to exit and reap its exit status. static int join (ACE_hthread_t, - void ** = 0); + ACE_THR_FUNC_RETURN * = 0); /// Continue the execution of a previously suspended thread. static int resume (ACE_hthread_t); @@ -171,7 +171,7 @@ public: /// Exit the current thread and return "status". /// Should _not_ be called by main thread. - static void exit (void *status = 0); + static void exit (ACE_THR_FUNC_RETURN status = 0); /// Get the LWP concurrency level of the process. static int getconcurrency (void); diff --git a/ace/Thread.i b/ace/Thread.i index 610b84f1ad0..f678c47b336 100644 --- a/ace/Thread.i +++ b/ace/Thread.i @@ -57,7 +57,7 @@ ACE_Thread::self (void) } ACE_INLINE void -ACE_Thread::exit (void *status) +ACE_Thread::exit (ACE_THR_FUNC_RETURN status) { ACE_TRACE ("ACE_Thread::exit"); ACE_OS::thr_exit (status); @@ -118,7 +118,7 @@ ACE_Thread::kill (ACE_thread_t t_id, int signum) ACE_INLINE int ACE_Thread::join (ACE_thread_t wait_for, ACE_thread_t *departed, - void **status) + ACE_THR_FUNC_RETURN *status) { ACE_TRACE ("ACE_Thread::join"); return ACE_OS::thr_join (wait_for, departed, status); @@ -126,7 +126,7 @@ ACE_Thread::join (ACE_thread_t wait_for, ACE_INLINE int ACE_Thread::join (ACE_hthread_t wait_for, - void **status) + ACE_THR_FUNC_RETURN *status) { ACE_TRACE ("ACE_Thread::join"); return ACE_OS::thr_join (wait_for, status); diff --git a/ace/Thread_Adapter.cpp b/ace/Thread_Adapter.cpp index dd80e1a9699..7647112fe6c 100644 --- a/ace/Thread_Adapter.cpp +++ b/ace/Thread_Adapter.cpp @@ -43,7 +43,7 @@ ACE_Thread_Adapter::~ACE_Thread_Adapter (void) { } -void * +ACE_THR_FUNC_RETURN ACE_Thread_Adapter::invoke (void) { // Inherit the logging features if the parent thread has an @@ -93,7 +93,7 @@ ACE_Thread_Adapter::invoke (void) return this->invoke_i (); } -void * +ACE_THR_FUNC_RETURN ACE_Thread_Adapter::invoke_i (void) { // Extract the arguments. @@ -126,7 +126,7 @@ ACE_Thread_Adapter::invoke_i (void) #endif /* ACE_NEEDS_LWP_PRIO_SET */ - void *status = 0; + ACE_THR_FUNC_RETURN status = 0; ACE_SEH_TRY { @@ -139,21 +139,17 @@ ACE_Thread_Adapter::invoke_i (void) // Invoke the start hook to give the user a chance to // perform some initialization processing before the // is invoked. - status = hook->start (ACE_reinterpret_cast (ACE_THR_FUNC, func), - arg); + status = hook->start (func, arg); else { // Call thread entry point. #if defined (ACE_PSOS) + status = 0; (*func) (arg); #else /* ! ACE_PSOS */ - status = ACE_reinterpret_cast (void *, (*func) (arg)); + status = (*func) (arg); #endif /* ACE_PSOS */ } -#if defined (ACE_PSOS) - // pSOS task functions do not return a value. - status = 0; -#endif /* ACE_PSOS */ } #if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) diff --git a/ace/Thread_Adapter.h b/ace/Thread_Adapter.h index 8e18e6c230f..d5ee674a486 100644 --- a/ace/Thread_Adapter.h +++ b/ace/Thread_Adapter.h @@ -28,17 +28,17 @@ class ACE_Thread_Descriptor; /** * @class ACE_Thread_Adapter * - * @brief Converts a C++ function into a function - * function that can be called from a thread creation routine - * (e.g., or <_beginthreadex>) that expects an + * @brief Converts a C++ function into a function that + * can be called from a thread creation routine + * (e.g., pthread_create() or _beginthreadex()) that expects an * extern "C" entry point. This class also makes it possible to * transparently provide hooks to register a thread with an - * . + * ACE_Thread_Manager. * - * This class is used in . In general, the + * This class is used in ACE_OS::thr_create(). In general, the * thread that creates an object of this class is different from - * the thread that calls on this object. Therefore, - * the method is responsible for deleting itself. + * the thread that calls @c invoke() on this object. Therefore, + * the @c invoke() method is responsible for deleting itself. */ class ACE_Export ACE_Thread_Adapter : public ACE_Base_Thread_Adapter { @@ -60,7 +60,7 @@ public: * , thereby rendering the object useless after the call * returns. */ - virtual void *invoke (void); + virtual ACE_THR_FUNC_RETURN invoke (void); /// Accessor for the optional . ACE_Thread_Manager *thr_mgr (void); @@ -71,7 +71,7 @@ private: /// Called by invoke, mainly here to separate the SEH stuff because /// SEH on Win32 doesn't compile with local vars with destructors. - virtual void *invoke_i (void); + virtual ACE_THR_FUNC_RETURN invoke_i (void); private: /// Optional thread manager. diff --git a/ace/Thread_Control.cpp b/ace/Thread_Control.cpp index e5fff02d507..c5828d61842 100644 --- a/ace/Thread_Control.cpp +++ b/ace/Thread_Control.cpp @@ -71,8 +71,8 @@ ACE_Thread_Control::~ACE_Thread_Control (void) // Exit from thread (but clean up first). -void * -ACE_Thread_Control::exit (void *exit_status, int do_thr_exit) +ACE_THR_FUNC_RETURN +ACE_Thread_Control::exit (ACE_THR_FUNC_RETURN exit_status, int do_thr_exit) { ACE_OS_TRACE ("ACE_Thread_Control::exit"); diff --git a/ace/Thread_Control.h b/ace/Thread_Control.h index fbf8f0f213f..ed32db58184 100644 --- a/ace/Thread_Control.h +++ b/ace/Thread_Control.h @@ -32,14 +32,14 @@ class ACE_Thread_Manager; * @brief Used to keep track of a thread's activities within its entry * point function. * - * A uses this class to ensure that threads + * A ACE_Thread_Manager uses this class to ensure that threads * it spawns automatically register and unregister themselves * with it. * This class can be stored in thread-specific storage using the - * wrapper. When a thread exits the + * ACE_TSS wrapper. When a thread exits the * function deletes this object, thereby * ensuring that it gets removed from its associated - * . + * ACE_Thread_Manager. */ class ACE_Export ACE_Thread_Control { @@ -53,10 +53,10 @@ public: /// the thread if is enabled. ~ACE_Thread_Control (void); - /// Remove this thread from its associated and exit - /// the thread if is enabled. - void *exit (void *status, - int do_thr_exit); + /// Remove this thread from its associated ACE_Thread_Manager and exit + /// the thread if @a do_thr_exit is enabled. + ACE_THR_FUNC_RETURN exit (ACE_THR_FUNC_RETURN status, + int do_thr_exit); /// Store the and use it to register ourselves for /// correct shutdown. @@ -70,10 +70,10 @@ public: ACE_Thread_Manager *thr_mgr (ACE_Thread_Manager *); /// Set the exit status (and return existing status). - void *status (void *status); + ACE_THR_FUNC_RETURN status (ACE_THR_FUNC_RETURN status); /// Get the current exit status. - void *status (void); + ACE_THR_FUNC_RETURN status (void); /// Dump the state of an object. void dump (void) const; @@ -86,7 +86,7 @@ private: ACE_Thread_Manager *tm_; /// Keeps track of the exit status for the thread. - void *status_; + ACE_THR_FUNC_RETURN status_; }; # if defined (ACE_HAS_INLINED_OSCALLS) diff --git a/ace/Thread_Control.inl b/ace/Thread_Control.inl index 29cb24b1df3..0c2ab504112 100644 --- a/ace/Thread_Control.inl +++ b/ace/Thread_Control.inl @@ -3,8 +3,8 @@ // Set the exit status. -ACE_INLINE void * -ACE_Thread_Control::status (void *s) +ACE_INLINE ACE_THR_FUNC_RETURN +ACE_Thread_Control::status (ACE_THR_FUNC_RETURN s) { ACE_OS_TRACE ("ACE_Thread_Control::status"); return this->status_ = s; @@ -12,7 +12,7 @@ ACE_Thread_Control::status (void *s) // Get the exit status. -ACE_INLINE void * +ACE_INLINE ACE_THR_FUNC_RETURN ACE_Thread_Control::status (void) { ACE_OS_TRACE ("ACE_Thread_Control::status"); diff --git a/ace/Thread_Hook.cpp b/ace/Thread_Hook.cpp index 08c37afbaf6..4d7a582f6c5 100644 --- a/ace/Thread_Hook.cpp +++ b/ace/Thread_Hook.cpp @@ -5,7 +5,7 @@ ACE_RCSID(ace, Thread_Hook, "$Id$") -void * +ACE_THR_FUNC_RETURN ACE_Thread_Hook::start (ACE_THR_FUNC func, void *arg) { diff --git a/ace/Thread_Hook.h b/ace/Thread_Hook.h index 591e50193d6..deec5544479 100644 --- a/ace/Thread_Hook.h +++ b/ace/Thread_Hook.h @@ -37,12 +37,12 @@ public: * This method can be overridden in a subclass to customize this * pre-function call "hook" invocation that can perform * initialization processing before the thread entry point - * method is called back. The and passed into the + * method is called back. The @a func and @a arg passed into the * start hook are the same as those passed by the application that * spawned the thread. */ - virtual void *start (ACE_THR_FUNC func, - void *arg); + virtual ACE_THR_FUNC_RETURN start (ACE_THR_FUNC func, + void *arg); /// sets the system wide thread hook, returns the previous thread /// hook or 0 if none is set. diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index 64956589aba..331e3c5b036 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -1363,7 +1363,7 @@ ACE_Thread_Manager::cancel_all (int async_cancel) } int -ACE_Thread_Manager::join (ACE_thread_t tid, void **status) +ACE_Thread_Manager::join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status) { ACE_TRACE ("ACE_Thread_Manager::join"); @@ -1527,8 +1527,8 @@ ACE_Thread_Manager::wait_grp (int grp_id) // Must be called when thread goes out of scope to clean up its table // slot. -void * -ACE_Thread_Manager::exit (void *status, int do_thr_exit) +ACE_THR_FUNC_RETURN +ACE_Thread_Manager::exit (ACE_THR_FUNC_RETURN status, int do_thr_exit) { ACE_TRACE ("ACE_Thread_Manager::exit"); #if defined(ACE_USE_ONE_SHOT_AT_THREAD_EXIT) diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h index f88edf7ccba..af0253096b9 100644 --- a/ace/Thread_Manager.h +++ b/ace/Thread_Manager.h @@ -577,13 +577,16 @@ public: ACE_Task_Base *task = 0); /** - * Called to clean up when a thread exits. If is - * non-0 then is called to exit the thread, in - * which case is passed as the exit value of the thread. + * Called to clean up when a thread exits. + * + * @arg do_thread_exit If non-0 then ACE_Thread::exit is called to + * exit the thread + * @arg status If ACE_Thread_Exit is called, this is passed as + * the exit value of the thread. * Should _not_ be called by main thread. */ - void *exit (void *status = 0, - int do_thread_exit = 1); + ACE_THR_FUNC_RETURN exit (ACE_THR_FUNC_RETURN status = 0, + int do_thread_exit = 1); /** * Block until there are no more threads running in the @@ -607,7 +610,7 @@ public: int abandon_detached_threads = 0); /// Join a thread specified by . Do not wait on a detached thread. - int join (ACE_thread_t tid, void **status = 0); + int join (ACE_thread_t tid, ACE_THR_FUNC_RETURN *status = 0); /** * Block until there are no more threads running in a group. diff --git a/ace/config-all.h b/ace/config-all.h index b4170f4fc7c..8c69aa6ee60 100644 --- a/ace/config-all.h +++ b/ace/config-all.h @@ -600,7 +600,40 @@ typedef ACE_HANDLE ACE_SOCKET; #endif /* ACE_WIN32 */ -typedef void *(*ACE_THR_FUNC)(void *); +// Define the type that's returned from the platform's native thread +// functions. ACE_THR_FUNC_RETURN is the type defined as the thread +// function's return type, except when the thread function doesn't return +// anything (pSoS). The ACE_THR_FUNC_NO_RETURN_VAL macro is used to +// indicate that the actual thread function doesn't return anything. The +// rest of ACE uses a real type so there's no a ton of conditional code +// everywhere to deal with the possibility of no return type. +# if defined (VXWORKS) +//typedef FUNCPTR ACE_THR_FUNC; // where typedef int (*FUNCPTR) (...) +typedef int ACE_THR_FUNC_RETURN; +# elif defined (ACE_PSOS) +typedef int ACE_THR_FUNC_RETURN; +// pSOS task functions don't really return anything... this just makes it +// easier to deal with declaring variables internally in ACE. +# elif defined (ACE_WIN32) +typedef DWORD ACE_THR_FUNC_RETURN; +# else +typedef void* ACE_THR_FUNC_RETURN; +# endif /* VXWORKS */ +typedef ACE_THR_FUNC_RETURN (*ACE_THR_FUNC)(void *); + +// Now some platforms have special requirements... +# if defined (VXWORKS) +typedef FUNCPTR ACE_THR_FUNC_INTERNAL; // where typedef int (*FUNCPTR) (...) +# elif defined (ACE_PSOS) +typedef void (*ACE_THR_FUNC_INTERNAL)(void *); +# else +typedef ACE_THR_FUNC ACE_THR_FUNC_INTERNAL; +# endif /* VXWORKS */ + +extern "C" { +typedef void (*ACE_THR_C_DEST)(void *); +} +typedef void (*ACE_THR_DEST)(void *); # if defined (VXWORKS) # if defined (ghs) @@ -623,7 +656,7 @@ typedef FUNCPTR ACE_THR_C_FUNC; // where typedef int (*FUNCPTR) (...) typedef void (*PSOS_TASK_ENTRY_POINT)(); typedef void (*ACE_THR_C_FUNC)(void *); # else -typedef void *(*ACE_THR_C_FUNC)(void *); +typedef ACE_THR_FUNC_RETURN (*ACE_THR_C_FUNC)(void *); # endif /* VXWORKS */ } diff --git a/examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp b/examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp index 965f11a604a..09b48d6fffe 100644 --- a/examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp +++ b/examples/C++NPv1/RT_Thread_Per_Connection_Logging_Server.cpp @@ -57,7 +57,7 @@ RT_Thread_Per_Connection_Logging_Server::handle_data (ACE_SOCK_Stream *client) // For simplicity, the Thread_Per_Connection_Logging_Server methods // are duplicated here. -void *Thread_Per_Connection_Logging_Server::run_svc (void *arg) +ACE_THR_FUNC_RETURN Thread_Per_Connection_Logging_Server::run_svc (void *arg) { auto_ptr thread_args (ACE_static_cast (Thread_Args *, arg)); diff --git a/examples/C++NPv1/Thread_Per_Connection_Logging_Server.cpp b/examples/C++NPv1/Thread_Per_Connection_Logging_Server.cpp index d852f374b4a..719453fc811 100644 --- a/examples/C++NPv1/Thread_Per_Connection_Logging_Server.cpp +++ b/examples/C++NPv1/Thread_Per_Connection_Logging_Server.cpp @@ -17,7 +17,7 @@ static void sigterm_handler (int /* signum */) { /* No-op. */ } -void *Thread_Per_Connection_Logging_Server::run_svc (void *arg) +ACE_THR_FUNC_RETURN Thread_Per_Connection_Logging_Server::run_svc (void *arg) { auto_ptr thread_args (ACE_static_cast (Thread_Args *, arg)); diff --git a/examples/C++NPv1/Thread_Per_Connection_Logging_Server.h b/examples/C++NPv1/Thread_Per_Connection_Logging_Server.h index 886f8091c6d..edf3651cf46 100644 --- a/examples/C++NPv1/Thread_Per_Connection_Logging_Server.h +++ b/examples/C++NPv1/Thread_Per_Connection_Logging_Server.h @@ -21,7 +21,7 @@ private: }; // Passed as a parameter to . - static void *run_svc (void *arg); + static ACE_THR_FUNC_RETURN run_svc (void *arg); protected: virtual int handle_connections (); diff --git a/examples/C++NPv2/AC_Client_Logging_Daemon.cpp b/examples/C++NPv2/AC_Client_Logging_Daemon.cpp index ddaad3c7dc2..601fa6e0ec7 100644 --- a/examples/C++NPv2/AC_Client_Logging_Daemon.cpp +++ b/examples/C++NPv2/AC_Client_Logging_Daemon.cpp @@ -175,7 +175,7 @@ public: int AC_Output_Handler::open (void *connector) { connector_ = - ACE_reinterpret_cast (AC_CLD_Connector *, connector); + ACE_static_cast (AC_CLD_Connector *, connector); int bufsiz = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; peer ().set_option (SOL_SOCKET, SO_SNDBUF, &bufsiz, sizeof bufsiz); diff --git a/examples/C++NPv2/Client_Logging_Daemon.cpp b/examples/C++NPv2/Client_Logging_Daemon.cpp index 346596a7f79..4e0ce41cfaa 100644 --- a/examples/C++NPv2/Client_Logging_Daemon.cpp +++ b/examples/C++NPv2/Client_Logging_Daemon.cpp @@ -48,13 +48,13 @@ public: protected: // Forward log records to the server logging daemon. - virtual void *forward (); + virtual ACE_THR_FUNC_RETURN forward (); // Send the buffered log records using a gather-write operation. virtual int send (ACE_Message_Block *chunk[], size_t &count); // Entry point into forwarder thread of control. - static void *run_svc (void *arg); + static ACE_THR_FUNC_RETURN run_svc (void *arg); // A synchronized that queues messages. ACE_Message_Queue msg_queue_; @@ -142,13 +142,13 @@ int CLD_Handler::open (CLD_Connector *connector) { } -void *CLD_Handler::run_svc (void *arg) { +ACE_THR_FUNC_RETURN CLD_Handler::run_svc (void *arg) { CLD_Handler *handler = ACE_static_cast (CLD_Handler *, arg); return handler->forward (); } -void *CLD_Handler::forward () { +ACE_THR_FUNC_RETURN CLD_Handler::forward () { ACE_Message_Block *chunk[ACE_IOV_MAX]; size_t message_index = 0; ACE_Time_Value time_of_last_send (ACE_OS::gettimeofday ()); diff --git a/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp b/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp index dc4d32920c0..8543892b6c0 100644 --- a/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp +++ b/examples/C++NPv2/Reactor_Logging_Server_Adapter.cpp @@ -15,8 +15,8 @@ template int Reactor_Logging_Server_Adapter::init (int argc, ACE_TCHAR *argv[]) { int i; - char *array = 0; - ACE_NEW_RETURN (array, new char *[argc], -1); + char **array = 0; + ACE_NEW_RETURN (array, char*[argc], -1); ACE_Auto_Array_Ptr char_argv (array); for (i = 0; i < argc; ++i) diff --git a/examples/C++NPv2/Select_Reactor_Logging_Server.cpp b/examples/C++NPv2/Select_Reactor_Logging_Server.cpp index 8afdc2141de..4f1dfcee48d 100644 --- a/examples/C++NPv2/Select_Reactor_Logging_Server.cpp +++ b/examples/C++NPv2/Select_Reactor_Logging_Server.cpp @@ -43,7 +43,7 @@ private: }; -static void *event_loop (void *arg) { +static ACE_THR_FUNC_RETURN event_loop (void *arg) { ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg); reactor->owner (ACE_OS::thr_self ()); @@ -52,7 +52,7 @@ static void *event_loop (void *arg) { } -static void *controller (void *arg) { +static ACE_THR_FUNC_RETURN controller (void *arg) { ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg); Quit_Handler *quit_handler = 0; diff --git a/examples/C++NPv2/Server_Shutdown.cpp b/examples/C++NPv2/Server_Shutdown.cpp index 66fab7716b2..9e371d81f01 100644 --- a/examples/C++NPv2/Server_Shutdown.cpp +++ b/examples/C++NPv2/Server_Shutdown.cpp @@ -41,7 +41,7 @@ private: }; -static void *controller (void *arg) { +static ACE_THR_FUNC_RETURN controller (void *arg) { ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg); Quit_Handler *quit_handler = 0; diff --git a/examples/C++NPv2/TP_Logging_Server.cpp b/examples/C++NPv2/TP_Logging_Server.cpp index d1a4dbd2eec..11f76255407 100644 --- a/examples/C++NPv2/TP_Logging_Server.cpp +++ b/examples/C++NPv2/TP_Logging_Server.cpp @@ -14,7 +14,7 @@ int TP_Logging_Handler::handle_input (ACE_HANDLE) { ACE_Message_Block *log_blk = 0; ACE_NEW_RETURN (log_blk, ACE_Message_Block - (ACE_reinterpret_cast (char *, this)), -1); + (ACE_static_cast (char *, this)), -1); log_blk->cont (mblk); ACE_GUARD_RETURN (ACE_Thread_Mutex, guard, lock_, -1); if (TP_LOGGING_TASK::instance ()->put (log_blk) == -1) @@ -49,7 +49,7 @@ TP_Logging_Handler::handle_close (ACE_HANDLE handle, int TP_Logging_Task::svc () { for (ACE_Message_Block *log_blk; getq (log_blk) != -1; ) { - TP_Logging_Handler *tp_handler = ACE_reinterpret_cast + TP_Logging_Handler *tp_handler = ACE_static_cast (TP_Logging_Handler *, log_blk->rd_ptr ()); Logging_Handler logging_handler (tp_handler->log_file ()); logging_handler.write_log_record (log_blk->cont ()); diff --git a/examples/C++NPv2/TP_Logging_Server.h b/examples/C++NPv2/TP_Logging_Server.h index 58dae64d078..40a77217dc1 100644 --- a/examples/C++NPv2/TP_Logging_Server.h +++ b/examples/C++NPv2/TP_Logging_Server.h @@ -102,8 +102,8 @@ public: virtual int init (int argc, ACE_TCHAR *argv[]) { int i; - char *array = 0; - ACE_NEW_RETURN (array, new char *[argc], -1); + char **array = 0; + ACE_NEW_RETURN (array, char*[argc], -1); ACE_Auto_Array_Ptr char_argv (array); for (i = 0; i < argc; ++i) diff --git a/examples/C++NPv2/TP_Reactor_Logging_Server.cpp b/examples/C++NPv2/TP_Reactor_Logging_Server.cpp index 9436d1fc9b2..5d4a3b37aba 100644 --- a/examples/C++NPv2/TP_Reactor_Logging_Server.cpp +++ b/examples/C++NPv2/TP_Reactor_Logging_Server.cpp @@ -44,7 +44,7 @@ private: }; -static void *event_loop (void *arg) { +static ACE_THR_FUNC_RETURN event_loop (void *arg) { ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg); reactor->owner (ACE_OS::thr_self ()); @@ -53,7 +53,7 @@ static void *event_loop (void *arg) { } -static void *controller (void *arg) { +static ACE_THR_FUNC_RETURN controller (void *arg) { ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg); Quit_Handler *quit_handler = 0; diff --git a/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp b/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp index e475a2e7de4..82b8a4c6d99 100644 --- a/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp +++ b/examples/C++NPv2/WFMO_Reactor_Logging_Server.cpp @@ -105,7 +105,7 @@ protected: }; -static void *event_loop (void *arg) { +static ACE_THR_FUNC_RETURN event_loop (void *arg) { ACE_Reactor *reactor = ACE_static_cast (ACE_Reactor *, arg); reactor->owner (ACE_OS::thr_self ()); diff --git a/examples/C++NPv2/display_logfile.cpp b/examples/C++NPv2/display_logfile.cpp index ee3a725ef60..1bf83fc08bd 100644 --- a/examples/C++NPv2/display_logfile.cpp +++ b/examples/C++NPv2/display_logfile.cpp @@ -142,21 +142,21 @@ public: // Demarshal the type ACE_CDR::Long *lp; - lp = ACE_reinterpret_cast + lp = ACE_static_cast (ACE_CDR::Long*, temp->wr_ptr ()); cdr >> *lp; temp->wr_ptr (sizeof (ACE_CDR::Long)); temp = temp->cont (); // Demarshal the pid - lp = ACE_reinterpret_cast + lp = ACE_static_cast (ACE_CDR::Long*, temp->wr_ptr ()); cdr >> *lp; temp->wr_ptr (sizeof (ACE_CDR::Long)); temp = temp->cont (); // Demarshal the time (2 Longs) - lp = ACE_reinterpret_cast + lp = ACE_static_cast (ACE_CDR::Long*, temp->wr_ptr ()); cdr >> *lp; ++lp; cdr >> *lp; temp->wr_ptr (2 * sizeof (ACE_CDR::Long)); diff --git a/examples/Connection/blocking/SPIPE-acceptor.cpp b/examples/Connection/blocking/SPIPE-acceptor.cpp index dcbd28c8f99..367b800c210 100644 --- a/examples/Connection/blocking/SPIPE-acceptor.cpp +++ b/examples/Connection/blocking/SPIPE-acceptor.cpp @@ -155,7 +155,7 @@ IPC_Server::parse_args (int argc, char *argv[]) return 0; } -static void * +static ACE_THR_FUNC_RETURN run_reactor_event_loop (void *) { ACE_DEBUG ((LM_DEBUG, "(%t) worker thread starting\n")); diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp index ecca683b831..094af0673b1 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inserver.cpp @@ -36,7 +36,7 @@ run_server (ACE_THR_FUNC server, // Function entry point into the twoway server task. -static void * +static ACE_THR_FUNC_RETURN twoway_server (void *arg) { ACE_INET_Addr cli_addr; @@ -148,7 +148,7 @@ twoway_server (void *arg) // Function entry point into the oneway server task. -static void * +static ACE_THR_FUNC_RETURN oneway_server (void *arg) { ACE_INET_Addr cli_addr; diff --git a/examples/IPC_SAP/SSL_SAP/SSL-server.cpp b/examples/IPC_SAP/SSL_SAP/SSL-server.cpp index b459c6c8417..b0ab5be2bc9 100644 --- a/examples/IPC_SAP/SSL_SAP/SSL-server.cpp +++ b/examples/IPC_SAP/SSL_SAP/SSL-server.cpp @@ -36,7 +36,7 @@ run_server (ACE_THR_FUNC server, // Function entry point into the twoway server task. -static void * +static ACE_THR_FUNC_RETURN twoway_server (void *arg) { ACE_INET_Addr cli_addr; @@ -149,7 +149,7 @@ twoway_server (void *arg) // Function entry point into the oneway server task. -static void * +static ACE_THR_FUNC_RETURN oneway_server (void *arg) { ACE_INET_Addr cli_addr; diff --git a/examples/Reactor/WFMO_Reactor/Abandoned.cpp b/examples/Reactor/WFMO_Reactor/Abandoned.cpp index ccc64db9057..6abe642900a 100644 --- a/examples/Reactor/WFMO_Reactor/Abandoned.cpp +++ b/examples/Reactor/WFMO_Reactor/Abandoned.cpp @@ -41,7 +41,7 @@ public: static int abandon = 1; -static void * +static ACE_THR_FUNC_RETURN worker (void *data) { Event_Handler *handler = (Event_Handler *) data; diff --git a/performance-tests/TCP/tcp_test.cpp b/performance-tests/TCP/tcp_test.cpp index f93ba193c37..3af48a8f0c5 100644 --- a/performance-tests/TCP/tcp_test.cpp +++ b/performance-tests/TCP/tcp_test.cpp @@ -414,7 +414,7 @@ Server::handle_close (ACE_HANDLE, return 0; } -static void * +static ACE_THR_FUNC_RETURN thread_pool_worker (void *) { // Server thread function. diff --git a/tests/ACE_Init_Test.cpp b/tests/ACE_Init_Test.cpp index 5f103920acc..c03e56ddfbd 100644 --- a/tests/ACE_Init_Test.cpp +++ b/tests/ACE_Init_Test.cpp @@ -46,7 +46,7 @@ main (int, char*[]) static char THIS_FILE[] = __FILE__; #endif -static void * wait_and_kill_dialog (void *pBox); +static ACE_THR_FUNC_RETURN wait_and_kill_dialog (void *pBox); ///////////////////////////////////////////////////////////////////////////// // CACE_Init_TestApp @@ -115,7 +115,7 @@ BOOL CACE_Init_TestApp::InitInstance() // This function runs in a separate thread - it will wait a couple of // seconds and then programatically dismiss the dialog box. If ACE is // not properly initialized, we will have crashed before getting here. -static void * +static ACE_THR_FUNC_RETURN wait_and_kill_dialog (void *pBox) { CACE_Init_TestDlg *pDialog = ACE_reinterpret_cast (CACE_Init_TestDlg *, diff --git a/tests/MEM_Stream_Test.cpp b/tests/MEM_Stream_Test.cpp index d2c2a6cd95f..4d1967b1a88 100644 --- a/tests/MEM_Stream_Test.cpp +++ b/tests/MEM_Stream_Test.cpp @@ -212,7 +212,7 @@ run_client (u_short port, return status; } -static void * +static ACE_THR_FUNC_RETURN connect_client (void *arg) { u_short *sport = ACE_reinterpret_cast (u_short *, arg); diff --git a/tests/Service_Config_DLL.cpp b/tests/Service_Config_DLL.cpp index d63bf011fe2..99f3848b4ef 100644 --- a/tests/Service_Config_DLL.cpp +++ b/tests/Service_Config_DLL.cpp @@ -7,7 +7,7 @@ ACE_RCSID (tests, Service_Config_DLL, "$Id$") -static void * +static ACE_THR_FUNC_RETURN invoke_service_config (void *arg) { const ACE_TCHAR *directive = ACE_reinterpret_cast (const ACE_TCHAR *, diff --git a/tests/Task_Test.cpp b/tests/Task_Test.cpp index 162b6693781..aad5cf3cc7a 100644 --- a/tests/Task_Test.cpp +++ b/tests/Task_Test.cpp @@ -31,8 +31,8 @@ ACE_RCSID(tests, Task_Test, "$Id$") class My_Thread_Hook : public ACE_Thread_Hook { public: - virtual void *start (ACE_THR_FUNC func, - void *arg); + virtual ACE_THR_FUNC_RETURN start (ACE_THR_FUNC func, + void *arg); }; class Barrier_Task : public ACE_Task @@ -67,7 +67,7 @@ Barrier_Task::Barrier_Task (ACE_Thread_Manager *thr_mgr, ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("activate failed"))); } -void * +ACE_THR_FUNC_RETURN My_Thread_Hook::start (ACE_THR_FUNC func, void *arg) { diff --git a/tests/Thread_Pool_Reactor_Resume_Test.cpp b/tests/Thread_Pool_Reactor_Resume_Test.cpp index bd55ab11688..3dde6a34920 100644 --- a/tests/Thread_Pool_Reactor_Resume_Test.cpp +++ b/tests/Thread_Pool_Reactor_Resume_Test.cpp @@ -236,7 +236,7 @@ reactor_event_hook (ACE_Reactor *) return 0; } -static void * +static ACE_THR_FUNC_RETURN svr_worker (void *) { // Server thread function. @@ -255,7 +255,7 @@ svr_worker (void *) return 0; } -static void * +static ACE_THR_FUNC_RETURN cli_worker (void *arg) { // Client thread function. @@ -298,7 +298,7 @@ cli_worker (void *arg) return 0; } -static void * +static ACE_THR_FUNC_RETURN worker (void *) { ACE_OS::sleep (3); diff --git a/tests/Thread_Pool_Reactor_Test.cpp b/tests/Thread_Pool_Reactor_Test.cpp index c2fe410b2b7..42c2fb8abf6 100644 --- a/tests/Thread_Pool_Reactor_Test.cpp +++ b/tests/Thread_Pool_Reactor_Test.cpp @@ -183,7 +183,7 @@ reactor_event_hook (ACE_Reactor *) return 0; } -static void * +static ACE_THR_FUNC_RETURN svr_worker (void *) { // Server thread function. @@ -202,7 +202,7 @@ svr_worker (void *) return 0; } -static void * +static ACE_THR_FUNC_RETURN cli_worker (void *arg) { // Client thread function. @@ -245,7 +245,7 @@ cli_worker (void *arg) return 0; } -static void * +static ACE_THR_FUNC_RETURN worker (void *) { ACE_OS::sleep (3); -- cgit v1.2.1