Skip to content

dynamic_lib misuses task::atomically in the check_for_errors_in implementations #8156

Closed
@mstewartgallus

Description

@mstewartgallus

Issue #8140 brought to my attention that some code in the dynamic library implementation was incorrect. After chatting to @bblum on IRC, I figured out my mistake in creating the implementation. Apparently the function task::atomically only asserts that no context switching occurs, and does not in fact prevent it. A corrected pair of check_for_errors_in functions should replace the use of task::atomically with some locking mechanism to prevent threads from stepping on each others use of errno (or the equivalent Win32 error variable.) Maybe this locking mechanism for safely accessing the error variable should also be exposed separately in Rust's OS interaction facilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions