8 import keyring |
8 import keyring |
9 import logging |
9 import logging |
10 |
10 |
11 from . import config |
11 from . import config |
12 from .scheduler import QueueThread, QueuedEvent |
12 from .scheduler import QueueThread, QueuedEvent |
|
13 from .exprotect import protect_noreturn |
13 |
14 |
14 logger=logging.getLogger(__name__) |
15 logger=logging.getLogger(__name__) |
15 |
16 |
16 class FIFOEvent(QueuedEvent): |
17 class FIFOEvent(QueuedEvent): |
17 def __init__(self, cond, name=None): |
18 def __init__(self, cond, name=None): |
27 # and a specified action executed. Otherwise this is not done. |
28 # and a specified action executed. Otherwise this is not done. |
28 class FIFO(QueueThread): |
29 class FIFO(QueueThread): |
29 def __init__(self, **kwargs): |
30 def __init__(self, **kwargs): |
30 super().__init__(target = self._fifo_thread, **kwargs) |
31 super().__init__(target = self._fifo_thread, **kwargs) |
31 |
32 |
|
33 @protect_noreturn |
32 def _fifo_thread(self): |
34 def _fifo_thread(self): |
33 with self._cond: |
35 with self._cond: |
34 while not self._terminate: |
36 while not self._terminate: |
35 ev=self._list |
37 ev=self._list |
36 if ev: |
38 if ev: |