threadlife.py

clew/threadlife.py

How a spawned thread ends: joined, detached, a daemon, or unknown — and the line that says so.

of

tuple[str | None, int | None] clew.threadlife.Lifecycles.of(self, Any spawn, str callee, str target, str kind)

How the thread a spawn call creates ends.

clew/threadlife.py:140

Show on the map →

Called by none

Calls _by_handle, _handle, _inline

Source · 12 lines
    def of(self, spawn: Any, callee: str, target: str, kind: str) -> tuple[str | None, int | None]:
        """Order: what the spawn expression itself says (chained, jthread, daemon), then the
        handle's ends — inside the spawning function for a local, anywhere in the file otherwise.

        @brief Lifecycle of one spawn.
        @return Pair.
        """
        if kind in NO_LIFECYCLE:
            return None, None
        found = self._inline(spawn, callee) or self._by_handle(*self._handle(spawn, callee, target))
        return found or (LIFECYCLE_UNKNOWN, None)
Activity · 4 steps
lines 147–147◇ if kind in NO_LIFECYCLElines 148–148return None, Nonelines 149–149found = self._inline(spawn, callee) or self._by_handle(*self._handle(spawn, callee, target))lines 150–150return found or (LIFECYCLE_UNKNOWN, None)

Requirements

REQ-DDB-SCHEMA-001