Skip to content

try_lock() always reports "WouldBlock" #21

@lbfs

Description

@lbfs

Hi!

I was playing around with this project and seeing if any of my code would work on a platform this old.

I tried this following snippet of code, but it always returns a "WouldBlock" failure. I see that on this version of the compiler, there are a few different Mutex implementations based on what support is available. Is the Mutex implementation that is used on Windows 98 incompatible with this try_lock() method?

    let mutex = Mutex::new(1);
    let guard = mutex.try_lock();

    match guard {
        Ok(_) => {
            println!("Got lock!");
        },
        Err(e) => {
            println!("{:#?}", e);
        }
    }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions