Permalink
Browse files

Docs, Refactoring

  • Loading branch information...
1 parent 2fb0d73 commit d930c252758316835fa5f679fd3bac1c4b019379 @kakserpom committed Mar 19, 2013
Showing with 39 additions and 8 deletions.
  1. +1 −1 lib/Daemon.php
  2. +32 −5 lib/ShmEntity.php
  3. +6 −2 lib/Thread.php
View
@@ -417,7 +417,7 @@ public static function getStateOfWorkers() {
Daemon::$shm_wstate->openAll();
$c = 0;
- foreach (Daemon::$shm_wstate->segments as $shm) {
+ foreach (Daemon::$shm_wstate->getSegments() as $shm) {
while ($offset < Daemon::SHM_WSTATE_SIZE) {
$buf = shmop_read($shm, $offset, $bufsize);
for ($i = 0, $buflen = strlen($buf); $i < $buflen; ++$i) {
View
@@ -1,10 +1,34 @@
<?php
class ShmEntity {
- public $path;
- public $segments = array();
- public $segsize = 1024;
- public $name;
- public $key;
+ /**
+ * Path
+ * @var string
+ */
+ protected $path;
+
+ /**
+ * Segments
+ * @var array
+ */
+ protected $segments = [];
+
+ /**
+ * Segment size
+ * @var integer
+ */
+ protected $segsize = 1024;
+
+ /**
+ * Name
+ * @var string
+ */
+ protected $name;
+
+ /**
+ * Key
+ * @var integer
+ */
+ protected $key;
public function __construct($path, $segsize, $name, $create = false) {
$this->path = $path;
@@ -49,6 +73,9 @@ public function open($segno = 0, $create = false) {
return $shm;
}
+ public function getSegments() {
+ return $this->segments;
+ }
public function openall() {
do {
$r = $this->open(sizeof($this->segments));
View
@@ -8,11 +8,15 @@
* @author Zorin Vasily <kak.serpom.po.yaitsam@gmail.com>
*/
abstract class Thread {
-
+
+ /**
+ * Process identificator
+ * @var int
+ */
protected $id;
/**
- * Process identificator
+ * PID
* @var int
*/
protected $pid;

0 comments on commit d930c25

Please sign in to comment.