Description
rust_builtin.cpp
has some builtins for accessing the "change_dir_lock" and the "global_args_lock". As evidenced by the fact that both of them accidentally use the same lock(!), this approach is prone to error. It would be better if the associated places in rust code could just use unstable::sync::LittleLock
directly.
For extra bonus points, we should be able to have unsafe mutable global LittleLocks that are lazily initialized in LittleLock::lock()
. This would allow atomically
to become totally private to unstable::sync
, as #7872 really wants.
(But, I can't figure out what's going on with the use of atomically
instead of LittleLock
in unstable::dynamic_lib::check_for_errors_in
. @sstewartgallus, git blame points to you -- can you shed light on this?)