diff options
author | Jim Carroll <thecarrolls@jiminger.com> | 2011-06-26 10:00:44 -0400 |
---|---|---|
committer | Jim Carroll <thecarrolls@jiminger.com> | 2011-06-26 10:06:22 -0400 |
commit | 5495bf571d81d41a55007961a0080e5950de7157 (patch) | |
tree | 076daaa892858905b9cd556e151892f271e8e95a /lib/UnrarXLib | |
parent | 090e664d5bb8205bb382cf0f14682afd992e0e29 (diff) |
Fixed the Unrar code broken by the threading refactor.
In several places in the rar code the new threading mechanisms were not used in a "functionally equivalent" manner. In five places the original code checked for a timeout using a "!= WAIT_OBJECT_0" which was interpreted as checking for a signaled state as if the "!" wasn't there. This commit fixes that problem.
Diffstat (limited to 'lib/UnrarXLib')
-rw-r--r-- | lib/UnrarXLib/extract.cpp | 2 | ||||
-rw-r--r-- | lib/UnrarXLib/rdwrfn.cpp | 4 | ||||
-rw-r--r-- | lib/UnrarXLib/unpack.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/UnrarXLib/extract.cpp b/lib/UnrarXLib/extract.cpp index 74a795b3cd..8206b187a9 100644 --- a/lib/UnrarXLib/extract.cpp +++ b/lib/UnrarXLib/extract.cpp @@ -867,7 +867,7 @@ void CmdExtract::UnstoreFile(ComprDataIO &DataIO,Int64 DestUnpSize) continue; DataIO.hBufferFilled->Reset(); DataIO.hBufferEmpty->Set(); - while (DataIO.hBufferFilled->WaitMSec(1)) + while (! DataIO.hBufferFilled->WaitMSec(1)) if (DataIO.hQuit->WaitMSec(1)) return; } diff --git a/lib/UnrarXLib/rdwrfn.cpp b/lib/UnrarXLib/rdwrfn.cpp index 6d1c055f1c..17e5b21b73 100644 --- a/lib/UnrarXLib/rdwrfn.cpp +++ b/lib/UnrarXLib/rdwrfn.cpp @@ -211,12 +211,12 @@ void ComprDataIO::UnpWrite(byte *Addr,uint Count) while(UnpackToMemorySize < (int)Count) { hBufferEmpty->Set(); - while( hBufferFilled->WaitMSec(1)) + while(! hBufferFilled->WaitMSec(1)) if (hQuit->WaitMSec(1)) return; } - if (hSeek->WaitMSec(1)) // we are seeking + if (! hSeek->WaitMSec(1)) // we are seeking { memcpy(UnpackToMemoryAddr,Addr,Count); UnpackToMemoryAddr+=Count; diff --git a/lib/UnrarXLib/unpack.cpp b/lib/UnrarXLib/unpack.cpp index 113260b121..265b54f5c4 100644 --- a/lib/UnrarXLib/unpack.cpp +++ b/lib/UnrarXLib/unpack.cpp @@ -411,7 +411,7 @@ void Unpack::Unpack29(bool Solid) if (UnpIO->UnpackToMemorySize > -1) { UnpIO->hBufferEmpty->Set(); - while (UnpIO->hBufferFilled->WaitMSec(1)) + while (! UnpIO->hBufferFilled->WaitMSec(1)) if (UnpIO->hQuit->WaitMSec(1)) return; } |