Documentation

Thread
in package

Allows you to initialize classes in another threads. At the same time, this class is using by the child thread to access the parent

Table of Contents

FinishSychnorization()  : void
Unjoins and unblocks parent-thread. ATTENTION! Until you call this method, the parent-thread will be frozen!
GetAllChildThreads()  : array<string|int, Threaded>
Returns all child threads
GetParentThreadedObject()  : ParentThreadedObject|null
GetParentThreadPid()  : int
Returns a PID of parent thread
GetParentThreadPort()  : int
Returns a port of parent thread
IsParentStillRunning()  : bool
Returns TRUE if parent thread still running
Run()  : Threaded
Initializes a parallel class
Threaded()  : void
This method calls automatically in child-thread when it was created.
WaitForParentAccess()  : mixed
Blocks child-thread and waits when parent-thread will join to child-thread

Methods

FinishSychnorization()

Unjoins and unblocks parent-thread. ATTENTION! Until you call this method, the parent-thread will be frozen!

public final FinishSychnorization() : void
Tags
throws
BadDataAccessException
Return values
void

GetAllChildThreads()

Returns all child threads

public final static GetAllChildThreads() : array<string|int, Threaded>
Return values
array<string|int, Threaded>

GetParentThreadPid()

Returns a PID of parent thread

public final GetParentThreadPid() : int
Return values
int

PID of parent thread

GetParentThreadPort()

Returns a port of parent thread

public final GetParentThreadPort() : int
Return values
int

Port of parent thread

IsParentStillRunning()

Returns TRUE if parent thread still running

public final IsParentStillRunning() : bool
Return values
bool

Run()

Initializes a parallel class

public final static Run(array<string|int, mixed> $args, object $handler) : Threaded
Parameters
$args : array<string|int, mixed>

Arguments which child-thread will get in Threaded(array $args) method

$handler : object

Any object that the child thread can access

Tags
throws
AbstractClassThreadException
throws
InvalidArgumentsPassedException
throws
NewThreadException|SystemMethodCallException
Return values
Threaded

Object which provides information and access to child-thread

Threaded()

This method calls automatically in child-thread when it was created.

public abstract Threaded(array<int, string> $args) : void
Parameters
$args : array<int, string>

Arguments passed by the parent thread in the static "Run(array $args, object $parentObject)" method

Return values
void

WaitForParentAccess()

Blocks child-thread and waits when parent-thread will join to child-thread

public final WaitForParentAccess() : mixed
Tags
throws
InvalidResultReceivedException
Return values
mixed

Search results