« * K @arv.tools

arv @arv.tools

2026-10-23 14:53 UTC

```js shared struct Counter { count = 0; lock = new Atomics.Mutex(); } ``` Pass a Counter to a worker and it gets the same object, not a copy. Take the lock with `using _ = Atomics.Mutex.lock(c.lock)` and count away.

A reply in a thread.

2 likes, 0 reposts, 1 replies

3 Next post4 More from @arv.toolsBackBluesky home
☆ Save to home · 0 Home · Find · Games · Chat · AI · Setup