3 ms·
One reason is probably emulating the way RAII works in C++, and allowing "low level" code to use idioms like { let _lock = acquire_lock();
by ben0x539 12y ago
One reason is probably emulating the way RAII works in C++, and allowing "low level" code to use idioms like
{
let _lock = acquire_lock();
use_resource();
} // lock is released here, whether use_resource() returned or caused stack unwinding
- hrjet 12y agoMakes a lot of sense: reduces generated code duplication. Just needs one "release" block per scope.