[Issue 17691] core.mutex.Mutex : {lock,unlock} should be @nogc

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jul 25 22:41:45 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17691

ZombineDev <petar.p.kirov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |petar.p.kirov at gmail.com
           Hardware|x86_64                      |All
         Resolution|---                         |WONTFIX
                 OS|Linux                       |All

--- Comment #1 from ZombineDev <petar.p.kirov at gmail.com> ---
Since those functions are virtual, adding any attribute to them is breaking
change, because it adds additional requirements to derived classes.

New code that doesn't need to use derived classes, should prefer the `final`
alternatives (lock_nothrow, tryLock_nothrow and unlock_nothrow). This violates
the "open" part of OCP, so a valid, though probably unrelated to your problem,
enhancement request is to create a class derived from Mutex that has all the
attributes, but allows those methods to be overridden.

--


More information about the Digitalmars-d-bugs mailing list