Skip to content

global little-locks (change_dir_lock, global_args_lock) are sloppy and wrong #8140

Closed
@bblum

Description

@bblum

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyC-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions