Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / tests / Reverse_Lock_Test.cpp
blobfa8d5c328687876a7d36c99ad536fda9a9fde30e
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 using REVERSE_MUTEX = ACE_Reverse_Lock<ACE_MT_SYNCH::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;