abort(safely:)
Aborts the thread.
func abort(safely: Bool = true) throws
Aborts the thread.
func abort(safely: Bool = true) throws
import MachCore
The core module for interacting with the Mach kernel.
class Thread
A thread in a task.
struct Mach
The Mach kernel.
@frozen struct Bool
A value type whose instances are either true
or false
.
func suspend() throws
Suspends the thread.
func resume() throws
Resumes the thread.
func terminate() throws
Terminates the thread.
convenience init(inTask task: Task) throws
Creates a new thread in a given task.
static var current: Mach.ThreadControl { get }
The current thread.
static func `switch`(to thread: Mach.Thread, option: Mach.ThreadSwitchOption = .none, timeout: mach_msg_timeout_t) throws
Switches to a thread.
var controlPort: Mach.ThreadControl { get throws }
The thread’s control port.
var exceptionPorts: [Mach.ExceptionPort] { get throws }
All the exception ports for the thread.
var info: Mach.ThreadInfoManager { get }
The thread’s info manager.
var inspectPort: Mach.ThreadInspect { get throws }
The thread’s inspect port.
var policy: Mach.ThreadPolicyManager { get }
The thread’s policy.
var readPort: Mach.ThreadRead { get throws }
The thread’s read port.
var state: Mach.ThreadStateManager { get }
The thread’s state.
func abortDepression() throws
Aborts the depression of the thread.
func addExceptionPort(_ exceptionPort: Mach.ExceptionPort) throws
Adds an exception port to the thread.
func exceptionPorts(mask: Mach.ExceptionMask) throws -> [Mach.ExceptionPort]
Gets the exception ports for the thread that catch the exception types specified by the mask.
func getSpecialPort<PortType>(_ specialPort: Mach.ThreadSpecialPort, as type: PortType.Type = PortType.self) throws -> PortType where PortType : Mach.Port
Gets a special port for the thread.
func getVoucher() throws -> Mach.Voucher
Gets the voucher for the thread.
func setSpecialPort(_ specialPort: Mach.ThreadSpecialPort, to port: Mach.Port) throws
Sets a special port for the thread.
func setVoucher(_ voucher: Mach.Voucher) throws
Sets the voucher for the thread.
func swapExceptionPort(_ exceptionPort: Mach.ExceptionPort) throws -> [Mach.ExceptionPort]
Swaps an exception port for the thread and returns the previous exception ports.
func swapVoucher(_ voucher: Mach.Voucher) throws -> Mach.Voucher
Sets the voucher for the thread and returns the previously-set voucher.
func unwire(in host: Mach.Host = .current) throws
Unwires a thread.
func wire(in host: Mach.Host = .current) throws
Wires a thread.