Unused druntime code: Barrier, ReadWriteMutex, Condition

Denis Feklushkin feklushkin.denis at gmail.com
Sun Jun 14 21:36:14 UTC 2026


While working on FreeRTOS support several years ago I discovered 
that druntime's classes Barrier, ReadWriteMutex and Condition 
weren't used at druntime or by compiler (CI with mentioned 
classes disabled https://github.com/dlang/dmd/pull/23265)

In fact, Barrier and ReadWriteMutex aren't used at all in any std 
D libraries or by compiler and Condition is used only in Phobos.

They all rely on Condition. The problem with it is that Condition 
uses primitive provided by the OS (pthread_condattr if Posix). 
However, not all operating systems provide this primitive 
(FreeRTOS for example) and this causes a problem out of nowhere.

Since this code is not necessary for Dlang's core functionality, 
I propose moving all mentioned classes to Phobos with appropriate 
warning messages


More information about the Digitalmars-d mailing list