diff options
Diffstat (limited to 'examples/APG/ThreadManagement/Start_Hook.cpp')
-rw-r--r-- | examples/APG/ThreadManagement/Start_Hook.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/examples/APG/ThreadManagement/Start_Hook.cpp b/examples/APG/ThreadManagement/Start_Hook.cpp deleted file mode 100644 index c1d9916d578..00000000000 --- a/examples/APG/ThreadManagement/Start_Hook.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// $Id$ - -#include "ace/Thread_Hook.h" -#include "ace/Task.h" -#include "ace/Log_Msg.h" - -#include "SecurityContext.h" - -// Listing 1 code/ch13 -class HA_ThreadHook : public ACE_Thread_Hook -{ -public: - virtual ACE_THR_FUNC_RETURN start (ACE_THR_FUNC func, void* arg) - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) New Thread Spawned\n"))); - - // Create the context on the thread's own stack. - ACE_TSS<SecurityContext> secCtx; - // Special initialization. - add_sec_context_thr (secCtx); - - return (*func) (arg); - } - - void add_sec_context_thr (ACE_TSS<SecurityContext> &secCtx); -}; -// Listing 1 - -void -HA_ThreadHook::add_sec_context_thr(ACE_TSS<SecurityContext> &secCtx) -{ - secCtx->user = 0; -} - - -class HA_CommandHandler : public ACE_Task_Base -{ -public: - virtual int svc (void) - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) starting up \n"))); - - // Do something. - - return 0; - } -}; -// Listing 2 code/ch13 -int ACE_TMAIN (int, ACE_TCHAR *[]) -{ - HA_ThreadHook hook; - ACE_Thread_Hook::thread_hook (&hook); - - HA_CommandHandler handler; - handler.activate (); - handler.wait(); - return 0; -} -// Listing 2 - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_TSS<SecurityContext>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_TSS<SecurityContext> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ |