1
0
Fork 0
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:
Brian Fiete 2021-12-31 10:27:09 -05:00
parent befc60aa63
commit 1201289f78
2 changed files with 137 additions and 7 deletions

View file

@ -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();