thread2537%python.module
fault.system

System thread primitives.

create

Create a new thread and run the given callable inside of it.

amutex

Allocate a synchronization primitive.

identify

Acquire an identifier to the executing thread.

sys
import

typing0
import

types0
import

signal0
import

_thread0
import

runtime0
import

create0
data

create = _thread.start_new_thread

amutex0
data

amutex = _thread.allocate_lock

identify0
data

identify = _thread.get_ident

Sever0
class

Exception used to signal thread kills.

Sever__kill__
data

__kill__ = True

snapshot325%
function
typing.Sequence[typing.Tuple[int, types.FrameType]]

snapshot(tids)

Select a set of threads from the same snapshot of frames.

interrupt70%
function

interrupt(tid, exception)

Raise the given exception in the thread with the given identifier, tid.

The thread being interrupted will be signalled after the exception has been set. This helps ensure that system calls will not stop the exception from being raised in order to kill the thread.

WARNING

Cases where usage is appropriate is rare. Managing the interruption of threads in this fashion is only appropriate in certain applications.

interruptParameters

tid

The thread's low-level identifier to interrupt.

exception

The exception that is raised in the thread.

setexc

Undocumented.

pthread_kill

Undocumented.

frame325%
function
types.FrameType

frame(tid)

Select the frame of the thread's identifier.

frameParameters

tid

Identifier of the thread returned by create_thread or identify_thread. Returns None when the thread is not running.

Transition0
class

A synchronization mechanism used to perform a single transfer between threads. Alternatively described as a queue with a transfer limit of one item.

Transition__slots__0
data

__slots__ = ('mutex', 'message')

Transition__init__30%
method

__init__(self)

Transition__iter__10%
method

__iter__(self)

Transitioncommit50%
method

commit(self)

Commit to the transition. If the object hasn't been placed, block until it is.

A RuntimeError will be raised upon multiple invocations of commit.

Transitiontransfer30%
method

transfer(self, message)

Send message to the receiving thread.