PHP Class Jamm\Memory\Shm\MultiAccess

Inheritance: implements Jamm\Memory\Shm\IMutex
Show file Open project: jamm/memory

Protected Properties

Property Type Description
$err_log
$max_wait_time
$mutex_acquired
$read_q
$read_q_key
$readers_count
$write_q
$write_q_key
$writers_count
$writers_mutex
$writers_mutex_key

Public Methods

Method Description
__construct ( $id = '' )
__destruct ( )
getErrLog ( )
getReadQKey ( )
getWriteQKey ( )
get_access_read ( &$auto_unlocker_reference )
get_access_write ( &$auto_unlocker_reference )
get_counter ( $type = self::writers )
release_access_read ( Jamm\Memory\IKeyLocker $autoUnlocker = NULL )
release_access_write ( Jamm\Memory\IKeyLocker $autoUnlocker = NULL )
setMaxWaitTime ( $max_wait_time )

Protected Methods

Method Description
acquire_writers_mutex ( ) : boolean Returned value of this function should not be ignored.
clean_queue ( $type = self::writers )
decrement ( $type = self::readers )
increment ( $type = self::readers )
release_writers_mutex ( )
select_q ( $type )
wait ( integer $type = self::writers ) : boolean Wait for queue. If this function has returned 'false', access should not be granted.

Method Details

__construct() public method

public __construct ( $id = '' )

__destruct() public method

public __destruct ( )

acquire_writers_mutex() protected method

'False' means that access should not be granted.
protected acquire_writers_mutex ( ) : boolean
return boolean

clean_queue() protected method

protected clean_queue ( $type = self::writers )

decrement() protected method

protected decrement ( $type = self::readers )

getErrLog() public method

public getErrLog ( )

getReadQKey() public method

public getReadQKey ( )

getWriteQKey() public method

public getWriteQKey ( )

get_access_read() public method

public get_access_read ( &$auto_unlocker_reference )

get_access_write() public method

public get_access_write ( &$auto_unlocker_reference )

get_counter() public method

public get_counter ( $type = self::writers )

increment() protected method

protected increment ( $type = self::readers )

release_access_read() public method

public release_access_read ( Jamm\Memory\IKeyLocker $autoUnlocker = NULL )
$autoUnlocker Jamm\Memory\IKeyLocker

release_access_write() public method

public release_access_write ( Jamm\Memory\IKeyLocker $autoUnlocker = NULL )
$autoUnlocker Jamm\Memory\IKeyLocker

release_writers_mutex() protected method

protected release_writers_mutex ( )

select_q() protected method

protected select_q ( $type )

setMaxWaitTime() public method

public setMaxWaitTime ( $max_wait_time )

wait() protected method

Wait for queue. If this function has returned 'false', access should not be granted.
protected wait ( integer $type = self::writers ) : boolean
$type integer
return boolean

Property Details

$err_log protected property

protected $err_log

$max_wait_time protected property

protected $max_wait_time

$mutex_acquired protected property

protected $mutex_acquired

$read_q protected property

protected $read_q

$read_q_key protected property

protected $read_q_key

$readers_count protected property

protected $readers_count

$write_q protected property

protected $write_q

$write_q_key protected property

protected $write_q_key

$writers_count protected property

protected $writers_count

$writers_mutex protected property

protected $writers_mutex

$writers_mutex_key protected property

protected $writers_mutex_key