Skip to content

release 0.5.1#126

Merged
mazong1123 merged 2 commits intomainfrom
release/0.5.1
Mar 27, 2026
Merged

release 0.5.1#126
mazong1123 merged 2 commits intomainfrom
release/0.5.1

Conversation

@mazong1123
Copy link
Copy Markdown
Collaborator

Release 0.5.1

Changes

  • InjectorPP::new_global() constructor — opt-in global (0.4.0-style) code patching that makes fakes visible to all threads, including background threads, timers, and thread pools like rayon.
  • Fix: Fakes not visible from rayon worker threads and background timer threads (fixes Mocking not working when used with rayon::join #121).
  • Fix: IAT thunk resolution in PatchGuard path on Windows x86_64.

Migration from 0.5.0

If you have tests that broke in 0.5.0 because faked functions are called from background threads (rayon, timers, etc.), change InjectorPP::new() to InjectorPP::new_global():

// Before (0.5.0 — fakes not visible to background threads)
let mut injector = InjectorPP::new();

// After (0.5.1 — fakes visible to all threads)
let mut injector = InjectorPP::new_global();

new() remains the default for thread-local dispatch with parallel test execution. new_global() acquires an exclusive lock, serializing tests that use it.

Files changed

  • Cargo.toml — version bump to 0.5.1
  • injectorpp-macros/Cargo.toml — version bump to 0.5.1
  • CHANGELOG.md — added 0.5.1 release notes
  • README.md — added "Thread-local vs Global mode" section with usage guide and rayon example, updated version
  • tests/global.rs — minor comment update

- Bump version to 0.5.1 in Cargo.toml, injectorpp-macros/Cargo.toml, README.md
- Add CHANGELOG entry for 0.5.1 with new_global() and bug fix for #121
- Add 'Thread-local vs Global mode' section to README with usage guide and rayon example

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mazong1123 mazong1123 changed the title chore: release 0.5.1 release 0.5.1 Mar 27, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mazong1123 mazong1123 merged commit 73b0710 into main Mar 27, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mocking not working when used with rayon::join

1 participant