Fix nothrow overloads of lock().

This commit is contained in:
Sönke Ludwig 2017-06-15 13:45:14 +02:00
parent 0d164708ec
commit 7d7e4709c1
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -37,11 +37,17 @@ pure nothrow @safe {
return ScopedLock!T(object);
}
/// ditto
void lock(T : const(Object))(shared(T) object, scope void delegate(scope T) accessor)
void lock(T : const(Object))(shared(T) object, scope void delegate(scope T) nothrow accessor)
nothrow {
auto l = lock(object);
accessor(l.unsafeGet());
}
/// ditto
void lock(T : const(Object))(shared(T) object, scope void delegate(scope T) accessor)
{
auto l = lock(object);
accessor(l.unsafeGet());
}
///
unittest {