1:1 source port of the engine and game code; Windows build and system layer; docs. No game files or SDK headers.

This commit is contained in:
CRTkafa 2026-10-22 16:30:40 +08:00
parent c3b032a45a
commit 0ecb47e9cb
3871 changed files with 91080 additions and 1640063 deletions

32
port/external/openal/CAMutex.h vendored Normal file
View file

@ -0,0 +1,32 @@
// Port of pflib/external/openal/CAMutex.h (Apple Core Audio utility class, Playground SDK 4.0): CAMutex, a pthread
// mutex that remembers its owning thread, so Lock / Try on the owning thread return without touching the pthread
// mutex. CAMutex.cpp is ported next to this file. Layout from the DWARF of parity-out/sdk/dbgobj/CAMutex.o
// (size 56): +0x00 vtable, +0x04 mName, +0x08 mOwner, +0x0c mMutex.
//
// The SDK header's nested Locker helper class is not carried (no ported code uses it). Callers lock with
// `bool wasLocked = guard.Lock();` and unlock only when that returned true (DWARF local "wasLocked").
#ifndef CAMUTEX_H_INCLUDED
#define CAMUTEX_H_INCLUDED
#include <pthread.h>
class CAMutex
{
public:
CAMutex(const char* inName);
virtual ~CAMutex();
virtual bool Lock();
virtual void Unlock();
virtual bool Try(bool& outWasLocked);
virtual bool IsFree() const;
virtual bool IsOwnedByCurrentThread() const;
protected:
const char* mName;
pthread_t mOwner;
pthread_mutex_t mMutex;
};
#endif