Skip to content

Commit

Permalink
Fix doc, threads are enabled by default now (#3665)
Browse files Browse the repository at this point in the history
* Fix doc, threads are enabled by default now

* Do not remove enable-thread, just mark at as deprecated
  • Loading branch information
ptitSeb authored Mar 8, 2023
1 parent 041c211 commit ed3895b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/c-api/src/wasm_c_api/unstable/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ pub extern "C" fn wasmer_features_delete(_features: Option<Box<wasmer_features_t
///
/// The [WebAssembly threads proposal][threads] is not currently fully
/// standardized and is undergoing development. Support for this feature can
/// be enabled through this method for appropriate WebAssembly modules.
/// be disabled through this method for appropriate WebAssembly modules.
///
/// This feature gates items such as shared memories and atomic
/// instructions.
///
/// This is `false` by default.
/// This is `true` by default.
///
/// [threads]: https://github.com/webassembly/threads
///
Expand Down
8 changes: 6 additions & 2 deletions lib/cli/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ pub struct WasmFeatures {
#[clap(long = "enable-simd")]
pub simd: bool,

/// Enable support for the threads proposal.
/// Disable support for the threads proposal.
#[clap(long = "disable-threads")]
pub disable_threads: bool,

/// Deprecated, threads are enabled by default.
#[clap(long = "enable-threads")]
pub threads: bool,
pub _threads: bool,

/// Enable support for the reference types proposal.
#[clap(long = "enable-reference-types")]
Expand Down
5 changes: 4 additions & 1 deletion lib/cli/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ impl CompilerOptions {

/// Get the enaled Wasm features.
pub fn get_features(&self, mut features: Features) -> Result<Features> {
if self.features.threads || self.features.all {
if !self.features.disable_threads || self.features.all {
features.threads(true);
}
if self.features.disable_threads && !self.features.all {
features.threads(false);
}
if self.features.multi_value || self.features.all {
features.multi_value(true);
}
Expand Down

0 comments on commit ed3895b

Please sign in to comment.