Unused druntime code: Barrier, ReadWriteMutex, Condition

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Jun 16 08:23:11 UTC 2026


On 16/06/2026 8:15 PM, Denis Feklushkin wrote:
> On Monday, 15 June 2026 at 23:50:01 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
> 
>>> The attempt to use standard Semaphore and Mutex in ondition 
>>> implementation failed because the current Condition semantics 
>>> requires @nogc, but Mutex and Semaphore are classes and 
>>> std.typecons.scoped isn't available in druntime.
>>
>> The implementation can be extracted into a package struct.
> 
> This leads to duplication of code what already available in 
> `std.typecons.scoped`

No.

I did not suggest anything to do with scoped.

All of the state and function calls to make it platform independent does 
not need to live in a class. It can live in a struct instead and then be 
called into.

```d
class Thing {
	private Thing2 thing2;

	void call() => thing2.call();
}

package:

struct Thing2 {
	void* state;

	void call() {
	}
}
```

>> Nothing needs to break to fix this.
> 
> Why you use "break" to describe this?
> I do not propose break anything: I propose to add `public import` from 
> `std.concurrency.rwmutex` (etc) into `core.sync.rwmutex` module with 
> appropriate deprecation messages.

Druntime cannot import phobos.

Phobos depends upon druntime.

Binary loading is acyclic, not cyclic.

No PR that tries to do this will be merged.



More information about the Digitalmars-d mailing list