GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
ThreadManager Class Reference

Public Member Functions

 add ($thread)
 
 remove ($thread)
 
 getAll ()
 
- Public Member Functions inherited from Threaded
 chunk ($size, bool $preserve=false)
 
 count ()
 
 isRunning ()
 
 isTerminated ()
 
 merge ($from, $overwrite=true)
 
 notify ()
 
 notifyOne ()
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetExists ($offset)
 
 offsetUnset ($offset)
 
 pop ()
 
 run ()
 
 shift ()
 
 synchronized (\Closure $function, $args=null)
 
 wait ($timeout)
 
 getRefCount ()
 
 addRef ()
 
 delRef ()
 
 isGarbage ()
 

Static Public Member Functions

static init ()
 
static getInstance ()
 
- Static Public Member Functions inherited from Threaded
static extend ($obj)
 

Member Function Documentation

◆ add()

add (   $thread)
Parameters
Worker | Thread$thread
52  {
53  if($thread instanceof Thread or $thread instanceof Worker){
54  $this->{spl_object_hash($thread)} = $thread;
55  }
56  }

◆ getAll()

getAll ( )
Returns
Worker[]|Thread[]
70  {
71  $array = [];
72  foreach($this as $key => $thread){
73  $array[$key] = $thread;
74  }
75 
76  return $array;
77  }

◆ getInstance()

static getInstance ( )
static
Returns
ThreadManager
45  {
46  return self::$instance;
47  }

◆ init()

static init ( )
static
38  {
39  self::$instance = new ThreadManager();
40  }

◆ remove()

remove (   $thread)
Parameters
Worker | Thread$thread
61  {
62  if($thread instanceof Thread or $thread instanceof Worker){
63  unset($this->{spl_object_hash($thread)});
64  }
65  }

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