Unused druntime code: Barrier, ReadWriteMutex, Condition

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Mon Jun 15 23:50:01 UTC 2026


On 16/06/2026 2:23 AM, Denis Feklushkin wrote:
> On Monday, 15 June 2026 at 10:35:39 UTC, Denis Feklushkin wrote:
>> On Monday, 15 June 2026 at 09:41:00 UTC, Denis Feklushkin wrote:
>>
>>> Most likely, these primitives do not exist in any OS - they are too 
>>> high-level and can be implemented on the basis of "more primitive" 
>>> primitives. (Posix implementation just provides convient wrapper, I 
>>> think)
>>
>> It is possible make PR on this base which will satisfy everyone. 
>> However, I'll wait for information about Windows (see previous message).
> 
> 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.

Nothing needs to break to fix this.

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



More information about the Digitalmars-d mailing list