Skip to content

Using replaceable operating system API plugins #120635

Closed
@zhuxiujia

Description

@zhuxiujia

Currently, I see that Mutex locks on Windows using TryAcquireSRWLockExclusive and AcquireSRWLockExclusive. The former only supports Windows 7 and above, while the latter supports Windows Vista and above.

Using the APIs of both resulted in compatibility only with Windows 7 and not supporting Windows XP, Windows 2003, Windows 2008. if you want run this exe will be can't find TryAcquireSRWLockExclusive on kernel32.dll

see this example :

fn main() {
    println!("Hello, world!");
}

image

What I want to ask is why not move the API called by the operating system to a replaceable plugin, such as the toolchain toolchain in Rust, so This is more flexible, and we can build our own toolchain that is compatible with older versions of the operating system

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions