mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-11 19:37:15 +01:00
Fix Deadlock in EventBus post #1493
This commit is contained in:
parent
6c4e684de9
commit
918d7229c2
@ -34,10 +34,16 @@ public class EventBus
|
||||
|
||||
public void post(Object event)
|
||||
{
|
||||
EventHandlerMethod[] handlers;
|
||||
lock.readLock().lock();
|
||||
try
|
||||
{
|
||||
EventHandlerMethod[] handlers = byEventBaked.get( event.getClass() );
|
||||
handlers = byEventBaked.get( event.getClass() );
|
||||
} finally
|
||||
{
|
||||
lock.readLock().unlock();
|
||||
}
|
||||
|
||||
if ( handlers != null )
|
||||
{
|
||||
for ( EventHandlerMethod method : handlers )
|
||||
@ -57,10 +63,6 @@ public class EventBus
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally
|
||||
{
|
||||
lock.readLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
private Map<Class<?>, Map<Byte, Set<Method>>> findHandlers(Object listener)
|
||||
|
Loading…
Reference in New Issue
Block a user