SIGN IN SIGN UP
oven-sh / bun UNCLAIMED

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

0 0 150 Rust

threading: delete unused init_with_mutex/into_unprotected/wait_and_deinit (#31544)

Dead-code sweep of `bun_threading`.

`cargo check --workspace` passes.

## Why this code exists

| Item | Zig original | Zig callers | Status |
|---|---|---|---|
| `GuardedBy::init_with_mutex` | `src/threading/guarded.zig:23`
(`initWithMutex`) | 0 external — only called internally by `init()` at
`:19` | **dead in Zig too** as a public API; inlined into the Rust
`init()` |
| `GuardedBy::into_unprotected` | `guarded.zig:46` (`intoUnprotected`) |
1 — `src/bun_alloc/allocation_scope.zig:191` | The Rust
`AllocationScope` was deleted (98ba4b19e6); no Rust equivalent of that
caller exists |
| `ThreadPool::wait_and_deinit` | `src/threading/ThreadPool.zig:288`
(`waitAndDeinit`) | 0 | **dead in Zig too** — callers invoke
`waitForAll`/`deinit` directly |
| `QUEUE_PADDING_LENGTH` | `src/threading/unbounded_queue.zig:81`
(`queue_padding_length`) | 0 external — used only as the `align()`
attribute on the struct's `back`/`front` fields (`:83,84`) | Zig
consumes the const in `align(queue_padding_length)`; Rust's
`#[repr(align(N))]` requires a literal, so the values are hardcoded on
`QueuePadded` and the const is unread |
| `CACHE_LINE_LENGTH` | `unbounded_queue.zig:1-6` (`cache_line_length`,
per-arch `switch`) | 0 external — only feeds `queue_padding_length` at
`:81` | Direct port of the Zig per-arch switch; cascaded dead once
`QUEUE_PADDING_LENGTH` was removed |
D
Dylan Conway committed
043a2bf5ac7d1d9aa65aeab2acde702a52136e26
Parent: 4d4cb71
Committed by GitHub <noreply@github.com> on 5/29/2026, 1:36:09 AM