diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-01-04 08:59:05 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2004-01-04 08:59:05 +0000 |
commit | 644004c0b8b5861a40765c2c533609a7b4172f3f (patch) | |
tree | fe24e09c05449c64cb8dd22a8626b5b59676561a | |
parent | 3ddca33175fe052deb231379517f01df18a4b0d1 (diff) | |
download | ATCD-644004c0b8b5861a40765c2c533609a7b4172f3f.tar.gz |
ChangeLogTag: Sun Jan 4 08:55:13 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | examples/APG/Proactor/HA_Proactive_Status.cpp | 15 | ||||
-rw-r--r-- | examples/APG/Proactor/HA_Proactive_Status.h | 4 | ||||
-rw-r--r-- | examples/APG/Signals/SigInfo.cpp | 14 | ||||
-rw-r--r-- | examples/APG/ThreadPools/Futures.cpp | 8 | ||||
-rw-r--r-- | examples/APG/ThreadPools/ThreadPool.cpp | 6 |
5 files changed, 40 insertions, 7 deletions
diff --git a/examples/APG/Proactor/HA_Proactive_Status.cpp b/examples/APG/Proactor/HA_Proactive_Status.cpp index 27590547a34..454215bc625 100644 --- a/examples/APG/Proactor/HA_Proactive_Status.cpp +++ b/examples/APG/Proactor/HA_Proactive_Status.cpp @@ -9,6 +9,8 @@ #include "ace/Proactor.h" #include "ace/os_include/arpa/os_inet.h" +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS)) + // Listing 1 code/ch08 void HA_Proactive_Service::open (ACE_HANDLE h, ACE_Message_Block&) @@ -152,3 +154,16 @@ template class ACE_Asynch_Acceptor<HA_Proactive_Service>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Asynch_Acceptor<HA_Proactive_Service> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION*/ + +#else + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_DEBUG ((LM_DEBUG, + "This example does not work on this platform.\n")); + return 1; +} + +#endif /* (ACE_WIN32 && != ACE_HAS_WINCE) || ACE_HAS_AIO_CALLS*/ + diff --git a/examples/APG/Proactor/HA_Proactive_Status.h b/examples/APG/Proactor/HA_Proactive_Status.h index 128c5bb5b05..8c31b432a22 100644 --- a/examples/APG/Proactor/HA_Proactive_Status.h +++ b/examples/APG/Proactor/HA_Proactive_Status.h @@ -14,6 +14,8 @@ // Listing 1 code/ch08 #include "ace/Asynch_IO.h" +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS)) + class HA_Proactive_Service : public ACE_Service_Handler { public: @@ -56,6 +58,8 @@ public: }; // Listing 2 +#endif /* (ACE_WIN32 && != ACE_HAS_WINCE) || ACE_HAS_AIO_CALLS*/ + #if 0 // Listing 3 code/ch08 template <class HANDLER> diff --git a/examples/APG/Signals/SigInfo.cpp b/examples/APG/Signals/SigInfo.cpp index 53eb8baec3b..9043c0b5bda 100644 --- a/examples/APG/Signals/SigInfo.cpp +++ b/examples/APG/Signals/SigInfo.cpp @@ -121,6 +121,8 @@ public: #endif /* ACE_LACKS_UNIX_SIGNALS */ +#if !defined (ACE_LACKS_UNIX_SIGNALS) + int ACE_TMAIN (int, ACE_TCHAR *[]) { #if defined (ACE_LACKS_FORK) @@ -150,3 +152,15 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) return 0; } + +#else + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_DEBUG ((LM_DEBUG, + "This example does not work on this platform.\n")); + return 1; +} + +#endif /* !ACE_LACKS_UNIX_SIGNALS */ diff --git a/examples/APG/ThreadPools/Futures.cpp b/examples/APG/ThreadPools/Futures.cpp index 10f81ea7750..36be10a5bb6 100644 --- a/examples/APG/ThreadPools/Futures.cpp +++ b/examples/APG/ThreadPools/Futures.cpp @@ -227,7 +227,7 @@ private: return (shutdown_ == 1); } - int thread_id (Worker *worker) + ACE_thread_t thread_id (Worker *worker) { return worker->thread_id (); } @@ -256,7 +256,7 @@ Manager::shut_down (void) Exit* req; ACE_NEW_RETURN (req, Exit(), -1); - + // Send the hangup message worker->perform(req); @@ -266,7 +266,7 @@ Manager::shut_down (void) ACE_DEBUG ((LM_DEBUG, "(%t) Worker %d shut down.\n", thread_id(worker))); - + delete worker; } @@ -285,7 +285,7 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) ACE_Time_Value tv; tv.msec (100); - + // Wait for a few seconds every time you send a message. CompletionCallBack cb; LongWork workArray[OUTSTANDING_REQUESTS]; diff --git a/examples/APG/ThreadPools/ThreadPool.cpp b/examples/APG/ThreadPools/ThreadPool.cpp index 3cb1164aa4a..89d99c16e50 100644 --- a/examples/APG/ThreadPools/ThreadPool.cpp +++ b/examples/APG/ThreadPools/ThreadPool.cpp @@ -101,7 +101,7 @@ public: ACE_Message_Block *mb = NULL; ACE_Time_Value tv ((long)MAX_TIMEOUT); tv += ACE_OS::time (0); - + // Get a message request. if (this->getq (mb, &tv) < 0) { @@ -130,7 +130,7 @@ public: int shut_down (void); - int thread_id (Worker *worker); + ACE_thread_t thread_id (Worker *worker); virtual int return_to_work (Worker *worker) { @@ -218,7 +218,7 @@ Manager::shut_down (void) return 0; } -int +ACE_thread_t Manager::thread_id (Worker *worker) { return worker->thread_id (); |