Core/Misc: Add some documentation to TRINITY_WRITE_GUARD and TRINITY_READ_GUARD because ACE's documentation on underlying objects is not clear.

This commit is contained in:
Machiavelli
2012-02-26 15:16:22 +01:00
parent ca17e1c7e4
commit b2e4f8f958

View File

@@ -208,10 +208,14 @@ typedef std::vector<std::string> StringVector;
ACE_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \
if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false);
//! For proper implementation of multiple-read, single-write pattern, use
//! ACE_RW_Mutex as underlying @MUTEX
# define TRINITY_WRITE_GUARD(MUTEX, LOCK) \
ACE_Write_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \
if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false);
//! For proper implementation of multiple-read, single-write pattern, use
//! ACE_RW_Mutex as underlying @MUTEX
# define TRINITY_READ_GUARD(MUTEX, LOCK) \
ACE_Read_Guard< MUTEX > TRINITY_GUARD_OBJECT (LOCK); \
if (TRINITY_GUARD_OBJECT.locked() == 0) ASSERT(false);