Correct the concurrent initialization pattern.
Dieser Commit ist enthalten in:
Ursprung
7b9d971238
Commit
9170e48992
@ -99,10 +99,14 @@ class PlayerSendingHandler {
|
|||||||
|
|
||||||
// Safe concurrent initialization
|
// Safe concurrent initialization
|
||||||
if (queues == null && createNew) {
|
if (queues == null && createNew) {
|
||||||
QueueContainer previous = playerSendingQueues.putIfAbsent(name, new QueueContainer());
|
final QueueContainer newContainer = new QueueContainer();
|
||||||
|
|
||||||
|
// Attempt to map the queue
|
||||||
|
queues = playerSendingQueues.putIfAbsent(name, newContainer);
|
||||||
|
|
||||||
if (previous != null)
|
if (queues == null) {
|
||||||
queues = previous;
|
queues = newContainer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for NULL again
|
// Check for NULL again
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren