Yate
ScriptMutex Class Referenceabstract

Script context serialization mutex. More...

#include <yatescript.h>

Inheritance diagram for ScriptMutex:
Mutex Lockable ScriptRun

Public Member Functions

 ScriptMutex (bool recursive, const char *name)
 
virtual void objCreated (GenObject *obj)=0
 
virtual void objDeleted (GenObject *obj)=0
 
bool objTrack () const
 
- Public Member Functions inherited from Mutex
 Mutex (bool recursive=false, const char *name=0)
 
 Mutex (const Mutex &original)
 
 ~Mutex ()
 
Mutexoperator= (const Mutex &original)
 
virtual bool lock (long maxwait=-1)
 
virtual bool unlock ()
 
virtual bool locked () const
 
const char * owner () const
 
bool recursive () const
 
- Public Member Functions inherited from Lockable
virtual ~Lockable ()
 
virtual bool check (long maxwait=-1)
 
virtual bool unlockAll ()
 

Protected Attributes

bool m_objTrack
 

Additional Inherited Members

- Static Public Member Functions inherited from Mutex
static int count ()
 
static int locks ()
 
static bool efficientTimedLock ()
 
- Static Public Member Functions inherited from Lockable
static void wait (unsigned long maxwait)
 
static unsigned long wait ()
 
static void startUsingNow ()
 
static void enableSafety (bool safe=true)
 
static bool safety ()
 

Detailed Description

Script context serialization mutex.

A mutex that serializes object access

Constructor & Destructor Documentation

◆ ScriptMutex()

ScriptMutex ( bool recursive,
const char * name )
inline

Constructor

Parameters
recursiveTrue if the mutex has to be recursive (reentrant), false for a normal fast mutex
nameStatic name of the mutex (for debugging purpose only)

References Mutex::Mutex(), and Mutex::recursive().

Member Function Documentation

◆ objCreated()

virtual void objCreated ( GenObject * obj)
pure virtual

Notification that an object was created in context serialized by this mutex

Parameters
objCreated object

Implemented in ScriptRun.

◆ objDeleted()

virtual void objDeleted ( GenObject * obj)
pure virtual

Notification that an object was destroyed in context serialized by this mutex

Parameters
objDestroyed object

Implemented in ScriptRun.

◆ objTrack()

bool objTrack ( ) const
inline

Check if object tracking is active

Returns
True if it's active, false otherwise

The documentation for this class was generated from the following file: