summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/proactor_events.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py
index 9b8ae06..229f56e 100644
--- a/Lib/asyncio/proactor_events.py
+++ b/Lib/asyncio/proactor_events.py
@@ -11,6 +11,7 @@ import os
import socket
import warnings
import signal
+import threading
import collections
from . import base_events
@@ -627,7 +628,9 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
proactor.set_loop(self)
self._make_self_pipe()
self_no = self._csock.fileno()
- signal.set_wakeup_fd(self_no)
+ if threading.current_thread() is threading.main_thread():
+ # wakeup fd can only be installed to a file descriptor from the main thread
+ signal.set_wakeup_fd(self_no)
def _make_socket_transport(self, sock, protocol, waiter=None,
extra=None, server=None):