Class SimpleMutex

Description

Simple Mutex Class

A Class that Acts as a simple Mutex on an abstract manner it Takes a Communication class and all Reading/Writting Process Must go through it it used with uncontrolled Communications (e.g. Shmop ) and not used with alredy controlled ones(e.g. MySQL)

Located in /Sync/SimpleMutex.php (line 16)


	
			
Variable Summary
Method Summary
 string Get (string $name)
 Boolean MLock ()
 void Set (string $name, string $value)
 void SetBusy ()
 void UnSetBusy ()
Variables
ComBasic $ComHelper (line 23)

The Communication Helper Wrapped

  • access: public
Methods
Constructor SimpleMutex (line 32)

Simple Mutex Class Constructor

Reading is Allowed at it's starting

SimpleMutex SimpleMutex (ComBasic $ComH)
Get (line 46)

Communication Varaibles Getter Function

it checks for the Availability of Reading , if not available it halts for 0.1 sec and tries again

  • todo: Make the 0.1sec value changeable by user and and set an upper waiting bound
string Get (string $name)
  • string $name
MLock (line 79)

The Lock Checking Function this function checks the existance of a lock over the Communication class through checking the "Read" Communication Varaible

  • return: Value indicating where Communication is locked or not
Boolean MLock ()
Set (line 66)

Communication Varaibles Setter Function

it sets a global lock and then changes the value then it releases the lock

  • todo: Think again if the Set function should check for the Existance of lock or not (Currently it doesn't)
void Set (string $name, string $value)
  • string $name
  • string $value
SetBusy (line 91)

Setting the Lock function

just set the "Read" value to "OFF"

void SetBusy ()
UnSetBusy (line 100)

Releasing the Lock function

just set the "Read" value to "ON"

void UnSetBusy ()

Documentation generated on Fri, 01 Aug 2008 05:54:17 +0300 by phpDocumentor 1.4.1