This commit is contained in:
Alistair Smith
2025-06-04 18:20:56 -07:00
parent 8dbaccf5e1
commit b72e83cd5a

View File

@@ -464,12 +464,6 @@ fn unhandledError(this: *WebWorker, _: anyerror) void {
this.flushLogs();
}
pub export fn WebWorkerLifecycleHandle__requestTermination(handle: ?*WebWorkerLifecycleHandle) void {
if (handle) |h| {
h.requestTermination();
}
}
fn spin(this: *WebWorker) void {
log("[{d}] spin start", .{this.execution_context_id});
@@ -662,6 +656,12 @@ pub fn exitAndDeinit(this: *WebWorker) noreturn {
bun.exitThread();
}
pub export fn WebWorkerLifecycleHandle__requestTermination(handle: ?*WebWorkerLifecycleHandle) void {
if (handle) |h| {
h.requestTermination();
}
}
/// Manages the complex timing surrounding web worker creation and destruction
const WebWorkerLifecycleHandle = struct {
const RefCount = bun.ptr.ThreadSafeRefCount(@This(), "ref_count", WebWorkerLifecycleHandle.deinit, .{});