mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Made BfpFile_Read cancelable
This commit is contained in:
parent
befc60aa63
commit
1201289f78
2 changed files with 137 additions and 7 deletions
|
@ -278,6 +278,7 @@ public:
|
|||
public:
|
||||
Kind mKind;
|
||||
bool mReleased;
|
||||
int mRefCount;
|
||||
|
||||
union
|
||||
{
|
||||
|
@ -290,6 +291,18 @@ public:
|
|||
{
|
||||
mKind = Kind_None;
|
||||
mReleased = false;
|
||||
mRefCount = 1;
|
||||
}
|
||||
|
||||
void AddRef()
|
||||
{
|
||||
BfpSystem_InterlockedExchangeAdd32((uint32*)&mRefCount, 1);
|
||||
}
|
||||
|
||||
void Release()
|
||||
{
|
||||
if (BfpSystem_InterlockedExchangeAdd32((uint32*)&mRefCount, (uint32)-1) == 1)
|
||||
delete this;
|
||||
}
|
||||
|
||||
~CeInternalData();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue