Skip to content

Commit

Permalink
[dotnet] Fix issue where await callbacks would be executed on Rust th…
Browse files Browse the repository at this point in the history
…read.
  • Loading branch information
emgre committed Oct 28, 2021
1 parent 4aac700 commit 5e95cf0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ci-script/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ci-script"
version = "0.1.2"
version = "0.1.4"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2018"

Expand Down
4 changes: 1 addition & 3 deletions ci-script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ fn run_builder<'a, B: BindingBuilder<'a>>(
);
}

if platforms.is_empty() {
panic!("No platforms found!");
}
assert!(!platforms.is_empty(), "No platforms found!");

let has_dynamic_libs = platforms.has_dynamic_lib();

Expand Down
2 changes: 1 addition & 1 deletion generators/c-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "c-oo-bindgen"
version = "0.1.2"
version = "0.1.4"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2018"

Expand Down
7 changes: 4 additions & 3 deletions generators/c-oo-bindgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,10 @@ fn get_link_dependencies(config: &CBindgenConfig) -> Vec<String> {
.output()
.expect("failed to run cargo");

if !output.status.success() {
panic!("failed to get the link dependencies");
}
assert!(
output.status.success(),
"failed to get the link dependencies"
);

// It prints to stderr for some reason
let result = String::from_utf8_lossy(&output.stderr);
Expand Down
2 changes: 1 addition & 1 deletion generators/dotnet-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dotnet-oo-bindgen"
version = "0.1.2"
version = "0.1.4"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2018"

Expand Down
5 changes: 4 additions & 1 deletion generators/dotnet-oo-bindgen/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@ fn generate_async_method(
callback_name, return_type, callback_param_name
))?;
blocked(f, |f| {
f.writeln(&format!("tcs.SetResult({});", callback_param_name))
f.writeln(&format!(
"Task.Run(() => tcs.SetResult({}));",
callback_param_name
))
})
})?;

Expand Down
2 changes: 1 addition & 1 deletion generators/java-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "java-oo-bindgen"
version = "0.1.2"
version = "0.1.4"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion generators/rust-oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-oo-bindgen"
version = "0.1.2"
version = "0.1.4"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion oo-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oo-bindgen"
version = "0.1.2"
version = "0.1.4"
authors = ["Émile Grégoire <emile@stepfunc.io>"]
edition = "2018"

Expand Down

0 comments on commit 5e95cf0

Please sign in to comment.