Skip to content

Feature request: poll_lock(cx) for Mutex #4

@black-binary

Description

@black-binary

I want to lock a Mutex in my poll_read method but it seems like that there is no way to lock and wait for a Mutex in a non-async function. My workaround is creating an async closure and getting it boxed and pinned, storing it somewhere else, and then polling it, which is really annoying and inefficient.

https://github.com/black-binary/ap-kcp/blob/6bf035ea0349165094bf44e13ff4b09cb2bf66ab/src/async_kcp.rs#L54-L67

I think it would be nice if there are some methods like poll_lock(cx).

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