summaryrefslogtreecommitdiff
path: root/ACE/tests/Reader_Writer_Test.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-10-23 13:53:24 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-10-23 13:53:24 +0000
commitcd006aaf4b33b71cd9187cb8a5b5e53839ab10b7 (patch)
tree0f76806608d97a3dbccbd3a93cba904d30504db1 /ACE/tests/Reader_Writer_Test.cpp
parent55d5e42b5a1f60622aa6cd6763352eba138afb1f (diff)
downloadATCD-cd006aaf4b33b71cd9187cb8a5b5e53839ab10b7.tar.gz
Tue Oct 23 13:51:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/tests/Reader_Writer_Test.cpp')
-rw-r--r--ACE/tests/Reader_Writer_Test.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/ACE/tests/Reader_Writer_Test.cpp b/ACE/tests/Reader_Writer_Test.cpp
index 4c18681d8f9..d268bed118f 100644
--- a/ACE/tests/Reader_Writer_Test.cpp
+++ b/ACE/tests/Reader_Writer_Test.cpp
@@ -61,8 +61,8 @@ static ACE_thread_t shared_data;
static ACE_RW_Thread_Mutex rw_mutex;
// Count of the number of readers and writers.
-static ACE_Atomic_Op<ACE_Thread_Mutex, int> current_readers;
-static ACE_Atomic_Op<ACE_Thread_Mutex, int> current_writers;
+static ACE_Atomic_Op<ACE_Thread_Mutex, long> current_readers;
+static ACE_Atomic_Op<ACE_Thread_Mutex, long> current_writers;
// Explain usage and exit.
static void
@@ -136,8 +136,8 @@ reader (void *)
if (result == 0)
{
- current_readers--;
- current_writers++;
+ --current_readers;
+ ++current_writers;
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%t) upgraded to write lock!\n")));
@@ -156,12 +156,12 @@ reader (void *)
shared_data));
}
- current_writers--;
+ --current_writers;
// we were a writer
}
else if (result == -1 && errno == EBUSY)
{
- current_readers--;
+ --current_readers;
// we were still a reader
ACE_DEBUG ((LM_DEBUG,
@@ -215,7 +215,7 @@ writer (void *)
ACE_Write_Guard<ACE_RW_Thread_Mutex> g (rw_mutex);
- current_writers++;
+ ++current_writers;
if (current_writers > 1)
ACE_DEBUG ((LM_DEBUG,
@@ -239,7 +239,7 @@ writer (void *)
shared_data));
}
- current_writers--;
+ --current_writers;
ACE_DEBUG((LM_DEBUG, ACE_TEXT (" (%t) write %d done at %T\n"), iterations));
}