@@ -117,10 +117,9 @@ def status(self):
117
117
============== =============================================
118
118
``pending`` Not yet started
119
119
``running`` Currently in-progress
120
- ``success`` Finished without error
120
+ ``completed`` Finished without error
121
+ ``cancelled`` Thread stopped after a cancel request
121
122
``error`` Exception occured in thread
122
- ``stopped`` Thread finished cleanly after a stop request
123
- ``terminated`` Thread killed after stop request timed out
124
123
============== =============================================
125
124
"""
126
125
return self ._status
@@ -194,11 +193,11 @@ def wrapped(*args, **kwargs):
194
193
self .started .set ()
195
194
try :
196
195
self ._return_value = f (* args , ** kwargs )
197
- self ._status = "success "
196
+ self ._status = "completed "
198
197
except (ActionKilledException , SystemExit ) as e :
199
198
logging .error (e )
200
- # Set state to terminated
201
- self ._status = "terminated "
199
+ # Set state to stopped
200
+ self ._status = "cancelled "
202
201
self .progress = None
203
202
except Exception as e : # skipcq: PYL-W0703
204
203
logging .error (e )
@@ -294,8 +293,8 @@ def terminate(self, exception=ActionKilledException):
294
293
while self ._is_thread_proc_running ():
295
294
pass
296
295
297
- # Set state to terminated
298
- self ._status = "terminated "
296
+ # Set state to stopped
297
+ self ._status = "cancelled "
299
298
self .progress = None
300
299
return True
301
300
@@ -318,7 +317,7 @@ def stop(self, timeout=None, exception=ActionKilledException):
318
317
# If the thread has stopped
319
318
if not self .is_alive ():
320
319
# Break
321
- self ._status = "stopped "
320
+ self ._status = "cancelled "
322
321
return True
323
322
# If the timeout tracker stopped before the thread died, kill it
324
323
logging .warning (f"Forcefully terminating thread { self } " )
0 commit comments