Unused druntime code: Barrier, ReadWriteMutex, Condition

Denis Feklushkin feklushkin.denis at gmail.com
Tue Jun 16 08:15:29 UTC 2026


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`

> 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.

>> This is another argument for moving this code to Phobos
>
> There is no valid argument here.
>
> To move it requires breaking user code, and that is not an 
> option.

Related - "Very telling quote":
https://forum.dlang.org/post/lkfdcbhqjdphvoaekpxq@forum.dlang.org 
(Very telling quote)


More information about the Digitalmars-d mailing list