Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2007-05-25 04:00:00 +0400
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:51 +0300
commitc574fc0f4bba94e693b0e22f730d355b75d4f4ce (patch)
treeda4ebd90c776d508ac679d50492f29461db80be0 /CPP/7zip/Common/InMemStream.h
parenta145bfc7cf17f7bbcfae8f0064333c8ea75b455c (diff)
4.46 beta
Diffstat (limited to 'CPP/7zip/Common/InMemStream.h')
-rwxr-xr-xCPP/7zip/Common/InMemStream.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/CPP/7zip/Common/InMemStream.h b/CPP/7zip/Common/InMemStream.h
index fcd0092d..73f344ee 100755
--- a/CPP/7zip/Common/InMemStream.h
+++ b/CPP/7zip/Common/InMemStream.h
@@ -82,11 +82,12 @@ class CResourceListMt: public CResourceList
public:
NWindows::NSynchronization::CSemaphore Semaphore;
- bool AllocateList(int numItems)
+ HRes AllocateList(int numItems)
{
if (!CResourceList::AllocateList(numItems))
return false;
- return Semaphore.Create((LONG)numItems, (LONG)numItems);
+ Semaphore.Close();
+ return Semaphore.Create(numItems, numItems);
}
int AllocateItem()
@@ -118,15 +119,15 @@ public:
CIntQueueMt(): _numItems(0), _head(0), _cur(0) {}
NWindows::NSynchronization::CSemaphore Semaphore;
- bool AllocateList(int numItems)
+ HRes AllocateList(int numItems)
{
FreeList();
if (numItems == 0)
- return true;
+ return S_OK;
if (!CIntListCheck::AllocateList(numItems))
- return false;
+ return E_OUTOFMEMORY;
_numItems = numItems;
- return Semaphore.Create((LONG)0, (LONG)numItems);
+ return Semaphore.Create(0, numItems);
}
void FreeList()
@@ -142,10 +143,8 @@ public:
_data[_head++] = value;
if (_head == _numItems)
_head = 0;
- LONG previousCount;
- Semaphore.Release(1, &previousCount);
+ Semaphore.Release();
// printf("\nRelease prev = %d\n", previousCount);
-
}
int GetItem()
@@ -253,7 +252,7 @@ public:
// to stop reading you must implement
// returning Error in IInMemStreamMtCallback::AllocateBlock
// and then you must free at least one substream
- bool StartReadThread();
+ HRes StartReadThread();
void Free();