Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Rust functions callable just like C functions from C code #4043

Closed
bstrie opened this issue Nov 26, 2012 · 2 comments
Closed

Make Rust functions callable just like C functions from C code #4043

bstrie opened this issue Nov 26, 2012 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries

Comments

@bstrie
Copy link
Contributor

bstrie commented Nov 26, 2012

< whidgle> is it possible to call a crust function as a callback from C code
           from a thread not created in rust?
< whidgle> sorry if that's not clear: rust calls something in c that expects
           callback fn, to which I pass a crust fn. Can the C code call that
           from another thread? It wasn't possible in go.
<@brson> only if that thread is a rust scheduler thread
<@brson> so no
<@brson> it will be possible in the future
<@brson> at some point Rust functions will be callable just like C functions,
         as long as you avoid certain paths that require the runtime
@Aatch
Copy link
Contributor

Aatch commented Jun 7, 2013

Is this still true? I believe that you can do this, as long as you, as @brson says, avoid using the runtime or any other calls that require a scheduler/TLS.

@pcwalton
Copy link
Contributor

This is basically done.

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

No branches or pull requests

3 participants