Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / ACE / tests / Reverse_Lock_Test.cpp
blobf9f8cefd2d66c517af3449e11b4761f7fc4e8db5
2 //=============================================================================
3 /**
4 * @file Reverse_Lock_Test.cpp
6 * This is a simple test to illustrate the functionality of
7 * ACE_Reverse_Lock. The test acquires and releases mutexes. No
8 * command line arguments are needed to run the test.
10 * @author Irfan Pyarali <irfan@cs.wustl.edu>
12 //=============================================================================
14 #include "test_config.h"
15 #include "ace/Synch_Traits.h"
16 #include "ace/Thread_Mutex.h"
17 #include "ace/Guard_T.h"
18 #include "ace/Reverse_Lock_T.h"
20 typedef ACE_Reverse_Lock<ACE_SYNCH_MUTEX> REVERSE_MUTEX;
22 int
23 run_main (int, ACE_TCHAR *[])
25 ACE_START_TEST (ACE_TEXT ("Reverse_Lock_Test"));
27 ACE_SYNCH_MUTEX mutex;
28 REVERSE_MUTEX reverse_mutex (mutex);
31 ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, monitor, mutex, -1);
33 ACE_GUARD_RETURN (REVERSE_MUTEX, reverse_monitor, reverse_mutex, -1);
36 ACE_END_TEST;
37 return 0;