5 #if !defined(_KKU_GOALKEEPERSIMPLE_) 6 #define _KKU_GOALKEEPERSIMPLE_ 8 #define GOALKEEPER_DEBUG 15 #include <semaphore.h> 36 GoalKeeperSimple (
const KKStr& _name);
139 void CriticalSectionStart ();
141 void CriticalSectionEnd ();
146 volatile bool blocked;
148 volatile kkint32 blockerThreadId;
bool BlockedByAnotherThread()
Returns true if a different thread has this instance of "GoalKeeperSimple" locked.
GoalKeeperSimpleList * GoalKeeperSimpleListPtr
static void Destroy(volatile GoalKeeperSimplePtr &_goalKeeperInstance)
Destroys an existing instance of GoalKeeperSimple.
kkint32 BlockerThreadId()
ThreadId of thread that currently holds the Block -1 indicates no Block.
A simple/ light-weight implementation of critical section blocking.
void EndBlock()
Ends the block and allows other threads to pass through StatBlock.
unsigned __int32 kkuint32
GoalKeeperSimpleList(bool _owner)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
static void CreateAndStartBlock(const KKStr &_name, volatile GoalKeeperSimplePtr &_newGoalKeeper, bool &_didNotExistYet)
Create a GoalKeeperSimple object and avoid a race condition doing it.
static void Create(const KKStr &_name, volatile GoalKeeperSimplePtr &_newGoalKeeper)
Create a GoalKeeperSimple object and avoid a race condition doing it.
void StartBlock()
Initiates a Block as long as another thread has not already locked this object.
static void FinalCleanUp()
Will be registered with 'atexit' so that it will be called when program is unloaded from memory...
const KKStr & Name() const
friend std::ostream & operator<<(std::ostream &os, const Matrix &matrix)
bool Blocked()
Will return true if any thread lock on this instance of "GoalKeeperSimple".
GoalKeeperSimple * GoalKeeperSimplePtr
kkint32 MemoryConsumedEstimated() const