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

42
ZUtil/ZMutex.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include <ZUtil/ZMutex.hpp>
#include <ZUtil/ZAssert.hpp>
//////////////////////////
/* ZLock Implementation */
//////////////////////////
ZMutex::ZMutex()
: Mutex(SST_Concurrency_CreateMutex())
{
ZASSERT_RUNTIME(Mutex != NULL, "ZMutex failed to allocate mutex from libsst-concurrency!");
}
ZMutex::~ZMutex()
{
SST_Concurrency_DestroyMutex(Mutex);
}
void ZMutex::Acquire()
{
SST_Concurrency_LockMutex(Mutex);
}
void ZMutex::Release()
{
SST_Concurrency_UnlockMutex(Mutex);
}
////////////////////////////////
/* ZScopedLock Implementation */
////////////////////////////////
ZLock::ZLock( ZMutex& _mutex )
: Mutex(_mutex)
{
Mutex.Acquire();
}
ZLock::~ZLock()
{
Mutex.Release();
}