From c2ac476b4930b399cc83ea90d85beb29f771f859 Mon Sep 17 00:00:00 2001 From: Steve Huston Date: Mon, 10 May 2004 18:50:00 +0000 Subject: ChangeLogTag:Mon May 10 14:42:29 2004 Steve Huston --- examples/APG/ThreadSafety/Barrier.cpp | 14 ++++++++++++++ examples/APG/ThreadSafety/Mutex.cpp | 15 +++++++++++++++ examples/APG/ThreadSafety/RW_Lock.cpp | 15 +++++++++++++++ examples/APG/ThreadSafety/Semaphore.cpp | 14 ++++++++++++++ examples/APG/ThreadSafety/TSS.cpp | 15 +++++++++++++++ 5 files changed, 73 insertions(+) (limited to 'examples/APG/ThreadSafety') diff --git a/examples/APG/ThreadSafety/Barrier.cpp b/examples/APG/ThreadSafety/Barrier.cpp index 22f738cab38..b07a08f0cee 100644 --- a/examples/APG/ThreadSafety/Barrier.cpp +++ b/examples/APG/ThreadSafety/Barrier.cpp @@ -1,5 +1,8 @@ // $Id$ +#include "ace/config-lite.h" +#if defined (ACE_HAS_THREADS) + #include "ace/OS_NS_stdlib.h" #include "ace/OS_NS_time.h" #include "ace/Task.h" @@ -75,3 +78,14 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) } // Listing 1 +#else +#include "ace/OS_main.h" +#include "ace/OS_NS_stdio.h" + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_OS::puts (ACE_TEXT ("This example requires threads.")); + return 0; +} + +#endif /* ACE_HAS_THREADS */ diff --git a/examples/APG/ThreadSafety/Mutex.cpp b/examples/APG/ThreadSafety/Mutex.cpp index 073a7ecfb3e..19bbc1cd34c 100644 --- a/examples/APG/ThreadSafety/Mutex.cpp +++ b/examples/APG/ThreadSafety/Mutex.cpp @@ -1,5 +1,8 @@ // $Id$ +#include "ace/config-lite.h" +#if defined (ACE_HAS_THREADS) + #include "ace/Synch.h" class LogMessage @@ -52,3 +55,15 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) return 0; } // Listing 1 + +#else +#include "ace/OS_main.h" +#include "ace/OS_NS_stdio.h" + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_OS::puts (ACE_TEXT ("This example requires threads.")); + return 0; +} + +#endif /* ACE_HAS_THREADS */ diff --git a/examples/APG/ThreadSafety/RW_Lock.cpp b/examples/APG/ThreadSafety/RW_Lock.cpp index 395df7c2f5d..3e2fd4c9f17 100644 --- a/examples/APG/ThreadSafety/RW_Lock.cpp +++ b/examples/APG/ThreadSafety/RW_Lock.cpp @@ -1,5 +1,8 @@ // $Id$ +#include "ace/config-lite.h" +#if defined (ACE_HAS_THREADS) + #include "ace/Synch.h" #include "ace/Containers.h" #include "ace/Task.h" @@ -128,3 +131,15 @@ template class ACE_DLList; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_DLList #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#else +#include "ace/OS_main.h" +#include "ace/OS_NS_stdio.h" + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_OS::puts (ACE_TEXT ("This example requires threads.")); + return 0; +} + +#endif /* ACE_HAS_THREADS */ diff --git a/examples/APG/ThreadSafety/Semaphore.cpp b/examples/APG/ThreadSafety/Semaphore.cpp index 2ab1bb633cd..47a85d86874 100644 --- a/examples/APG/ThreadSafety/Semaphore.cpp +++ b/examples/APG/ThreadSafety/Semaphore.cpp @@ -1,5 +1,8 @@ // $Id$ +#include "ace/config-lite.h" +#if defined (ACE_HAS_THREADS) + #include "ace/OS_NS_string.h" #include "ace/Task.h" #include "ace/Synch.h" @@ -131,3 +134,14 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) } // Listing 3 +#else +#include "ace/OS_main.h" +#include "ace/OS_NS_stdio.h" + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_OS::puts (ACE_TEXT ("This example requires threads.")); + return 0; +} + +#endif /* ACE_HAS_THREADS */ diff --git a/examples/APG/ThreadSafety/TSS.cpp b/examples/APG/ThreadSafety/TSS.cpp index 7a10831a3e9..49e264d2f62 100644 --- a/examples/APG/ThreadSafety/TSS.cpp +++ b/examples/APG/ThreadSafety/TSS.cpp @@ -1,5 +1,8 @@ // $Id$ +#include "ace/config-lite.h" +#if defined (ACE_HAS_THREADS) + #include "ace/Synch.h" #include "ace/Task.h" #include "ClientContext.h" @@ -72,3 +75,15 @@ template class ACE_Hash_Map_Iterator_Base_Ex,ACE_Equal_To,ACE_Null_Mutex> #pragma instantiate ACE_Hash_Map_Iterator_Base_Ex, ACE_Equal_To, ACE_Null_Mutex> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +#else +#include "ace/OS_main.h" +#include "ace/OS_NS_stdio.h" + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_OS::puts (ACE_TEXT ("This example requires threads.")); + return 0; +} + +#endif /* ACE_HAS_THREADS */ -- cgit v1.2.1