7 ms·
Copying a mutex by value (thus duplicating the lock, causing deadlocks or worse) is far too easy
by wazzaps 3y ago
Copying a mutex by value (thus duplicating the lock, causing deadlocks or worse) is far too easy
- icholy 3y ago`go vet` catches this.
- mhh__ 3y agoI use a tool called "type theory"
- icholy 3y agoKeep posting about D, I'm sure it will catch on soon.
- erik_seaberg 3y agoIs there a way to declare any type uncopyable? This is something I always thought Ada got right.
- deleted 3y ago[deleted]
- smasher164 3y agoyou stick this in your struct type noCopy struct{} func (*noCopy) Lock() {} func (*noCopy) Unlock() {}
- usefulcat 3y agoWow, even c++ won't let you do that (without invoking undefined behavior, anyway).