Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
ShmHandler Class Reference
Collaboration diagram for ShmHandler:
Collaboration graph

Public Member Functions

 ShmHandler ($key=98374, $size=131072)
 getLock ()
 releaseLock ()
 store (&$what, $key)
 restore (&$what, $key)
 dispose ()
 halt ($msg)

Data Fields

 $shmKey
 $shmSize
 $shmid
 $semid
 $debug = true

Member Function Documentation

dispose ( )

release shared memory segment

public

Here is the call graph for this function:

getLock ( )

acquire semaphore lock

private

Here is the call graph for this function:

Here is the caller graph for this function:

halt (   $msg)

print error message and exit script

private

Parameters
string$msgthe message to print

Here is the caller graph for this function:

releaseLock ( )

release semaphore lock

private

Here is the call graph for this function:

Here is the caller graph for this function:

restore ( $what,
  $key 
)

restores a variable from shared memory

public

Parameters
mixed&$whatvariable to restore (call by reference)
integer$keythe key from which to store

Here is the call graph for this function:

ShmHandler (   $key = 98374,
  $size = 131072 
)

constructor

does nothing special, just acquires handles for a memory segment and a semaphore to it

public

Parameters
integer$keymust be unique on this machine
integer$sizein bytes

Here is the call graph for this function:

store ( $what,
  $key 
)

stores a variable in shared memory

public

Parameters
mixed&$whatvariable to store (call by reference)
integer$keythe key under which to store

Here is the call graph for this function:

Field Documentation

$debug = true
$semid
$shmid
$shmKey
$shmSize

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