Browse Source

corrected a 64-bit issue in ReadWriteLock

tags/2021-05-28
jules 17 years ago
parent
commit
fa401f1952
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      juce_amalgamated.cpp
  2. +2
    -2
      src/juce_core/threads/juce_ReadWriteLock.cpp

+ 2
- 2
juce_amalgamated.cpp View File

@@ -14325,7 +14325,7 @@ void ReadWriteLock::exitRead() const throw()
{ {
if (readerThreads.getUnchecked(i) == threadId) if (readerThreads.getUnchecked(i) == threadId)
{ {
const int newCount = ((int) (Thread::ThreadID) readerThreads.getUnchecked (i + 1)) - 1;
const pointer_sized_int newCount = ((pointer_sized_int) readerThreads.getUnchecked (i + 1)) - 1;


if (newCount == 0) if (newCount == 0)
{ {
@@ -14334,7 +14334,7 @@ void ReadWriteLock::exitRead() const throw()
} }
else else
{ {
readerThreads.set (i + 1, (Thread::ThreadID) (pointer_sized_int) newCount);
readerThreads.set (i + 1, (Thread::ThreadID) newCount);
} }


return; return;


+ 2
- 2
src/juce_core/threads/juce_ReadWriteLock.cpp View File

@@ -99,7 +99,7 @@ void ReadWriteLock::exitRead() const throw()
{ {
if (readerThreads.getUnchecked(i) == threadId) if (readerThreads.getUnchecked(i) == threadId)
{ {
const int newCount = ((int) (Thread::ThreadID) readerThreads.getUnchecked (i + 1)) - 1;
const pointer_sized_int newCount = ((pointer_sized_int) readerThreads.getUnchecked (i + 1)) - 1;
if (newCount == 0) if (newCount == 0)
{ {
@@ -108,7 +108,7 @@ void ReadWriteLock::exitRead() const throw()
} }
else else
{ {
readerThreads.set (i + 1, (Thread::ThreadID) (pointer_sized_int) newCount);
readerThreads.set (i + 1, (Thread::ThreadID) newCount);
} }
return; return;


Loading…
Cancel
Save