Skip to documentation
SLOP

tiny.coz.Thread

Reference tiny.coz Thread

Defined in thread.

API (13)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callsthreadThread
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/coz/src/thread.zig:14

zig
pub const Thread = struct {    delay_state: delay.ThreadState = .{},    sampler: sampler_mod.Sampler = .{},    record_scratch: [record_scratch_size]u8 = undefined,    callchain_scratch: [callchain_scratch_len]usize = undefined,    pub fn openCurrent(options: sampler_mod.Options) !Thread {        return .{ .sampler = try sampler_mod.Sampler.openCurrentThread(options) };    }    pub fn openAndStartCurrent(options: sampler_mod.Options) !Thread {        var thread = try openCurrent(options);        errdefer thread.close();        try thread.sampler.start();        return thread;    }    pub fn close(self: *Thread) void {        self.sampler.close();    }    pub fn process(        self: *Thread,        profiler: *profiler_mod.Profiler,        record_scratch: []u8,        callchain_scratch: []usize,        wait: sampler_mod.WaitFn,    ) !usize {        if (!self.delay_state.acquireUse()) return 0;        defer self.delay_state.setInUse(false);        return profiler.processSampler(&self.delay_state, &self.sampler, record_scratch, callchain_scratch, wait);    }    pub fn processDefault(        self: *Thread,        profiler: *profiler_mod.Profiler,        wait: sampler_mod.WaitFn,    ) !usize {        return self.process(profiler, &self.record_scratch, &self.callchain_scratch, wait);    }    pub fn drain(        self: *Thread,        profiler: *profiler_mod.Profiler,        record_scratch: []u8,        callchain_scratch: []usize,    ) !usize {        if (!self.delay_state.acquireUse()) return 0;        defer self.delay_state.setInUse(false);        return profiler.drainSampler(            &self.delay_state,            &self.sampler,            record_scratch,            callchain_scratch,        );    }    pub fn drainDefault(self: *Thread, profiler: *profiler_mod.Profiler) !usize {        return self.drain(profiler, &self.record_scratch, &self.callchain_scratch);    }    pub fn drainResolved(        self: *Thread,        profiler: *profiler_mod.Profiler,        allocator: std.mem.Allocator,        scope: debug_info.Scope,        record_scratch: []u8,        callchain_scratch: []usize,    ) !usize {        if (!self.delay_state.acquireUse()) return 0;        defer self.delay_state.setInUse(false);        return profiler.drainResolvedSampler(allocator, &self.delay_state, &self.sampler, record_scratch, callchain_scratch, scope);    }    pub fn drainResolvedDefault(        self: *Thread,        profiler: *profiler_mod.Profiler,        allocator: std.mem.Allocator,        scope: debug_info.Scope,    ) !usize {        return self.drainResolved(profiler, allocator, scope, &self.record_scratch, &self.callchain_scratch);    }};

Source: lib/coz/src/root.zig:64

zig
pub const Thread = thread.Thread;
Called byCallsNo direct callstest sourcelib.coz.src.threadtest: thread runtime close is idempot...Threadclose
Static calls · unresolved targets: 1 · external targets: 0.
Called byCallsThreaddrainDefaultdelay.ThreadStateacquireUsedelay.ThreadStatesetInUseThreaddrain
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallstest sourcelib.coz.src.threadtest: thread runtime final drain does...ThreaddrainThreaddrainDefault
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsThreaddrainResolvedDefaultdelay.ThreadStateacquireUsedelay.ThreadStatesetInUseThreaddrainResolved
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callersThreaddrainResolvedThreaddrainResolvedDefault
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsRuntimestartThreadopenCurrentThreadopenAndStartCurrent
Static calls · unresolved targets: 1 · external targets: 1.
Called byCallsNo direct callsThreadopenAndStartCurrentThreadopenCurrent
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsThreadprocessDefaulttest sourcelib.coz.src.threadtest: thread runtime processes sample...test sourcelib.coz.src.threadtest: thread runtime skips processing...delay.ThreadStateacquireUsedelay.ThreadStatesetInUseThreadprocess
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallstest sourcelib.coz.src.threadtest: thread runtime default processi...ThreadprocessThreadprocessDefault
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions10
Public names20
Members4
Version26.7.0
Revisiondaab053ee433