Initial commit

This commit is contained in:
2026-04-03 00:22:39 -05:00
commit eca1e8c458
945 changed files with 218160 additions and 0 deletions

33
ZUtil/ZReadWriteLock.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include <ZUtil/ZReadWriteLock.hpp>
#include <ZUtil/ZAssert.hpp>
ZReadWriteLock::ZReadWriteLock()
: Lock(SST_Concurrency_CreateReadWriteLock())
{
ZASSERT_RUNTIME(Lock != NULL, "ZReadWriteLock failed to allocate lock from libsst-concurrency!");
}
ZReadWriteLock::~ZReadWriteLock()
{
SST_Concurrency_DestroyReadWriteLock(Lock);
}
bool ZReadWriteLock::LockForReading( uint32_t ticks ) const
{
return SST_Concurrency_LockForReading(Lock, ticks) != 0;
}
bool ZReadWriteLock::LockForWriting( uint32_t ticks )
{
return SST_Concurrency_LockForWriting(Lock, ticks) != 0;
}
void ZReadWriteLock::EndReading( ) const
{
SST_Concurrency_EndReading(Lock);
}
void ZReadWriteLock::EndWriting( )
{
SST_Concurrency_EndWriting(Lock);
}