Days since finding an unchecked Sendable that uses locks subtly wrong: 0️⃣
@mattiem Also worth mentioning: you don't need 'unchecked' if you're using Mutex. The compiler can validate lock usage.
@tclementdev Yes this is a great combo. OSAllocatedUnfairLock isn’t too bad either, though not as safe.
@mattiem would love to know more about how it was wrong. Incorrectly modeled critical section, which could result in violated invariants? (The most common such mistake in my experience)
@calicoding Nah just making it really easy to accidentally smuggle non-Sendable stuff around. It’s hard to prevent that in a guaranteed way. Mutex does all kinds of trickery to pull it off.