You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix target-specific feature gating in the WASM adapter - #493
#496 is a narrower alternative to this PR. It only gates the unsafe impl Send/Sync on WasmBuffer and WasmBufferReader to wasm32, and uses Arc<Mutex> for native builds. The browser build is unchanged, and it adds a native test that pushes from another thread while a reader waits.
It leaves out two parts of this PR:
Removing the guard that stops native builds with wasm-runtime on. Without the guard, a native build with default features compiles, but sleep returns at once, the clock always reads 0 and logs are dropped. Before, the build failed with a clear message.
The file reorganisation. It's fine as cleanup, but it's better reviewed on its own.
Two other points if this PR goes ahead:
lock_state uses .expect("...poisoned"). A panicking T::clone while the lock is held then makes every later call on that buffer panic. unwrap_or_else(PoisonError::into_inner) avoids this.
transform_join_integration_tests.rs is now wasm32-only, so plain cargo test no longer compiles it. The README now recommends that command.
Closing without merging. The adapter is browser-only, and native builds exist only as a test shortcut. Making native builds easier (dropping the compile_error! guard and adding a no-op time fallback) works against that. The guard correctly stops anyone building it natively by mistake, while the fallback would let such a build compile and silently do nothing. The narrower soundness fix in #496 is also closed, for the same reason.
The file reorganisation (cancellation.rs, time/browser.rs) is fine as cleanup if we want it later, as a separate PR with no behaviour changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
git diff --checkpassed. Tests were not run for this PR submission.