MCPcopy
hub / github.com/SwanHubX/SwanLab / join

Method join

swanlab/sdk/internal/pkg/timer/__init__.py:85–93  ·  view source on GitHub ↗

等待后台线程退出,通常配合 cancel() 使用以保证任务完整收尾。

(self, timeout: Optional[float] = None)

Source from the content-addressed store, hash-verified

83 self._stop_event.set()
84
85 def join(self, timeout: Optional[float] = None) -> None:
86 """
87 等待后台线程退出,通常配合 cancel() 使用以保证任务完整收尾。
88 """
89 with self._lock:
90 thread = self._thread
91
92 if thread is not None and thread.is_alive():
93 thread.join(timeout)
94
95 @property
96 def execution_count(self) -> int:

Callers 15

timer_managerFunction · 0.95
on_saveMethod · 0.45
on_saveMethod · 0.45
__init__Method · 0.45
generate_idFunction · 0.45
generate_nameFunction · 0.45
list_usersFunction · 0.45
list_projectsFunction · 0.45
list_groupsFunction · 0.45
show_resultFunction · 0.45
_format_cpu_memoryFunction · 0.45
_format_acceleratorsFunction · 0.45

Calls 1

is_aliveMethod · 0.80

Tested by 1

timer_managerFunction · 0.76