diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-07-31 16:14:11 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-07-31 16:14:11 +0000 |
commit | 9c2ec3049a5634f1c916d792e81fc80edb669ea8 (patch) | |
tree | 0d634e179761581cadbffe852e7f9a9f049b5c6e /examples/APG/ThreadSafety/Tokens_Deadlock.cpp | |
parent | 6540653cf736840d5aad719c73a8e43a549080be (diff) | |
download | ATCD-9c2ec3049a5634f1c916d792e81fc80edb669ea8.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-1_4_2'.TAO-1_4_2
Diffstat (limited to 'examples/APG/ThreadSafety/Tokens_Deadlock.cpp')
-rw-r--r-- | examples/APG/ThreadSafety/Tokens_Deadlock.cpp | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/examples/APG/ThreadSafety/Tokens_Deadlock.cpp b/examples/APG/ThreadSafety/Tokens_Deadlock.cpp deleted file mode 100644 index 8e1e254684a..00000000000 --- a/examples/APG/ThreadSafety/Tokens_Deadlock.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ - -#include "ace/Local_Tokens.h" -#include "ace/Task.h" -#include "ace/OS_NS_unistd.h" - -#if defined (ACE_HAS_TOKENS_LIBRARY) - -// Listing 1 code/ch14 -class ThreadOne : public ACE_Task_Base -{ -public: - virtual int svc (void) - { - ACE_Local_Mutex mutex1 ("resource1", - 0, // Deadlock detection enabled. - 1);// Debugging enabled. - mutex1.acquire (); - ACE_OS::sleep (2); - ACE_Local_Mutex mutex2 ("resource2", 0, 1); - mutex2.acquire (); - return 0; - } -}; - -class ThreadTwo : public ACE_Task_Base -{ -public: - virtual int svc (void) - { - ACE_Local_Mutex mutex2 ("resource2", - 0, // Deadlock detection enabled. - 1);// Debugging enabled. - mutex2.acquire (); - ACE_OS::sleep (2); - ACE_Local_Mutex mutex1 ("resource1", - 0, // Deadlock detection enabled. - 1);// Debugging enabled. - mutex1.acquire (); - return 0; - } -}; - -int ACE_TMAIN (int, ACE_TCHAR *[]) -{ - ThreadOne t1; - ThreadTwo t2; - - t1.activate (); - ACE_OS::sleep (1); - t2.activate (); - t1.wait (); - t2.wait (); - - return 0; -} -// Listing 1 - -#else /* defined (ACE_HAS_TOKENS_LIBRARY) */ - -int ACE_TMAIN (int, ACE_TCHAR *[]) -{ - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("local tokens not supported ") - ACE_TEXT ("on this platform\n"))); - return 0; -} - -#endif /* defined (ACE_HAS_TOKENS_LIBRARY) */ |