diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-24 16:53:27 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-24 16:53:27 +0000 |
commit | e173ad0583f6dfa2ce58b777c434c0906e1be292 (patch) | |
tree | 4232a1221f83956ea047668a0ff601d1a5547462 /TAO/tao/poa_macros.h | |
parent | 6327ce1265bd35827064d920c9d9bc4e05be6cd4 (diff) | |
download | ATCD-e173ad0583f6dfa2ce58b777c434c0906e1be292.tar.gz |
ChangeLogTag:Sat Jan 24 10:30:40 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/poa_macros.h')
-rw-r--r-- | TAO/tao/poa_macros.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/TAO/tao/poa_macros.h b/TAO/tao/poa_macros.h new file mode 100644 index 00000000000..b46ae1a10f8 --- /dev/null +++ b/TAO/tao/poa_macros.h @@ -0,0 +1,47 @@ +// Convenient macro for testing for deadlock, as well as for detecting +// when mutexes fail. +#define TAO_POA_WRITE_GUARD(MUTEX,OBJ,LOCK,ENV) \ + do { \ + ACE_Write_Guard<MUTEX> OBJ (LOCK); \ + if (OBJ.locked () == 0) \ + { \ + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); \ + ENV.exception (exception); \ + return; \ + } \ + } \ + while (0); +#define TAO_POA_READ_GUARD(MUTEX,OBJ,LOCK,ENV) \ + do { \ + ACE_Read_Guard<MUTEX> OBJ (LOCK); \ + if (OBJ.locked () == 0) \ + { \ + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); \ + ENV.exception (exception); \ + return; \ + } \ + } \ + while (0); +#define TAO_POA_WRITE_GUARD_RETURN(MUTEX,OBJ,LOCK,RETURN,ENV) \ + do { \ + ACE_Write_Guard<MUTEX> OBJ (LOCK); \ + if (OBJ.locked () == 0) \ + { \ + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); \ + ENV.exception (exception); \ + return RETURN; \ + } \ + } \ + while (0); +#define TAO_POA_READ_GUARD_RETURN(MUTEX,OBJ,LOCK,RETURN,ENV) \ + do { \ + ACE_Read_Guard<MUTEX> OBJ (LOCK); \ + if (OBJ.locked () == 0) \ + { \ + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); \ + ENV.exception (exception); \ + return RETURN; \ + } \ + } \ + while (0); + |