mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Socket: Move call to supybot.drivers.poll outside the critical section.
It may do some non-trivial stuff (eg. calling registry callbacks); and the less code in the locked-section the better.
This commit is contained in:
parent
aa2f9202ec
commit
88549f9faa
@ -145,6 +145,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
||||
|
||||
@classmethod
|
||||
def _select(cls):
|
||||
timeout = conf.supybot.drivers.poll()
|
||||
try:
|
||||
if not cls._selecting.acquire(blocking=False):
|
||||
# there's already a thread running this code, abort.
|
||||
@ -162,7 +163,7 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
||||
if not cls._instances:
|
||||
return
|
||||
rlist, wlist, xlist = select.select([x.conn for x in cls._instances],
|
||||
[], [], conf.supybot.drivers.poll())
|
||||
[], [], timeout)
|
||||
for instance in cls._instances:
|
||||
if instance.conn in rlist:
|
||||
instance._read()
|
||||
|
Loading…
Reference in New Issue
Block a user