diff options
author | shmel1k <shmel1k@ydb.tech> | 2023-11-26 18:16:14 +0300 |
---|---|---|
committer | shmel1k <shmel1k@ydb.tech> | 2023-11-26 18:43:30 +0300 |
commit | b8cf9e88f4c5c64d9406af533d8948deb050d695 (patch) | |
tree | 218eb61fb3c3b96ec08b4d8cdfef383104a87d63 /contrib/python/Twisted/py3/twisted/_threads/_convenience.py | |
parent | 523f645a83a0ec97a0332dbc3863bb354c92a328 (diff) | |
download | ydb-b8cf9e88f4c5c64d9406af533d8948deb050d695.tar.gz |
add kikimr_configure
Diffstat (limited to 'contrib/python/Twisted/py3/twisted/_threads/_convenience.py')
-rw-r--r-- | contrib/python/Twisted/py3/twisted/_threads/_convenience.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/python/Twisted/py3/twisted/_threads/_convenience.py b/contrib/python/Twisted/py3/twisted/_threads/_convenience.py new file mode 100644 index 0000000000..deff576462 --- /dev/null +++ b/contrib/python/Twisted/py3/twisted/_threads/_convenience.py @@ -0,0 +1,43 @@ +# -*- test-case-name: twisted._threads.test.test_convenience -*- +# Copyright (c) Twisted Matrix Laboratories. +# See LICENSE for details. + +""" +Common functionality used within the implementation of various workers. +""" + + +from ._ithreads import AlreadyQuit + + +class Quit: + """ + A flag representing whether a worker has been quit. + + @ivar isSet: Whether this flag is set. + @type isSet: L{bool} + """ + + def __init__(self): + """ + Create a L{Quit} un-set. + """ + self.isSet = False + + def set(self): + """ + Set the flag if it has not been set. + + @raise AlreadyQuit: If it has been set. + """ + self.check() + self.isSet = True + + def check(self): + """ + Check if the flag has been set. + + @raise AlreadyQuit: If it has been set. + """ + if self.isSet: + raise AlreadyQuit() |