+
+ /**
+ * {@inheritDoc}
+ */
+ public function getName()
+ {
+ return self::TYPE_SEMAPHORE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function getLocks(string $prefix = '')
+ {
+ // We can just return our own semaphore keys, since we don't know
+ // the state of other semaphores, even if the .sem files exists
+ $keys = array_keys(self::$semaphore);
+
+ if (empty($prefix)) {
+ return $keys;
+ } else {
+ $result = [];
+
+ foreach ($keys as $key) {
+ if (strpos($key, $prefix) === 0) {
+ array_push($result, $key);
+ }
+ }
+
+ return $result;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function releaseAll($override = false)
+ {
+ // Semaphores are just alive during a run, so there is no need to release
+ // You can just release your own locks
+ return parent::releaseAll($override);
+ }