Skip to content

Unclear when you need to be in a rust thread #15560

@mvdnes

Description

@mvdnes

Description

I am currently trying to interface with a C library (SDL) which runs on its own thread and need a callback.

First I wanted to use an Arc<RWLock<DList<T>>> for this purpose. When confronted with runtime failures, someone on the IRC pointed out to me that an RWLock can only be used from within a Rust thread.

This makes a lot of sense, but was not clear at all from the docs. Maybe it could be pointed out what functions / structures can not be used from a bare pthread?

(Also, is there a Lock which can be used both from a phtread and from a rust thread?)

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