February 23, 2018 [Issue 11216] Make synchronized statement `nothrow` | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=11216 --- Comment #11 from FeepingCreature <default_357-line@yahoo.de> --- Istm a possible approach would be: * Define SimpleMonitor : Monitor with nothrow * change DMD to use nothrow when locking SimpleMonitors * subclass druntime's Mutex with SimpleMutex : Mutex, SimpleMonitor * use SimpleMutex as the mutex implementation for class monitors Then synchronized(this) should be nothrow without breaking existing code that depends on Mutex/Monitor. It would only break if you were assigning to _monitor, and that's easily fixed by using a separate member. I don't know how to implement this on the DMD side though. -- |
Copyright © 1999-2021 by the D Language Foundation