PocketMine-MP
5.25.3 git-afc4a3c7f18d42b41cbfde84ab6a2e4dd7c03045
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
g
i
m
n
o
p
r
s
t
Functions
Variables
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Variables
$
a
c
d
e
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Files
File List
▼
PocketMine-MP
PocketMine-MP API Documentation
Deprecated List
►
Namespaces
►
Classes
▼
Files
▼
File List
►
src
▼
vendor
▼
pocketmine
►
bedrock-data
►
bedrock-protocol
►
binaryutils
►
callback-validator
►
color
►
errorhandler
►
log
►
math
►
nbt
►
raklib
►
raklib-ipc
▼
snooze
▼
src
SleeperHandler.php
SleeperHandlerEntry.php
SleeperNotifier.php
•
All
Classes
Namespaces
Functions
Variables
Enumerations
Enumerator
Pages
Loading...
Searching...
No Matches
SleeperNotifier.php
1
<?php
2
3
/*
4
* This file is part of Snooze <https://github.com/pmmp/Snooze>
5
* Copyright (c) 2018-2023 PMMP Team
6
*
7
* Snooze is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*/
12
13
declare(strict_types=1);
14
15
namespace
pocketmine\snooze;
16
17
use pmmp\thread\ThreadSafeArray;
18
23
final
class
SleeperNotifier
{
24
31
public
function
__construct(
32
private
readonly ThreadSafeArray $sharedObject,
33
private
readonly
int
$notifierId
34
){}
35
39
final
public
function
wakeupSleeper
() : void{
40
$shared = $this->sharedObject;
41
$sleeperId = $this->notifierId;
42
$shared->synchronized(
function
() use ($shared, $sleeperId) :
void
{
43
if
(!isset($shared[$sleeperId])){
44
$shared[$sleeperId] = $sleeperId;
45
$shared->notify();
46
}
47
});
48
}
39
final
public
function
wakeupSleeper
() : void {
…
}
49
}
23
final
class
SleeperNotifier
{
…
};
pocketmine\snooze\SleeperNotifier
Definition
SleeperNotifier.php:23
pocketmine\snooze\SleeperNotifier\wakeupSleeper
wakeupSleeper()
Definition
SleeperNotifier.php:39
vendor
pocketmine
snooze
src
SleeperNotifier.php
Generated by
1.12.0