Repository navigation
Port pinvoke-detach tests to Windows - #138004
Open
Samyra312007 wants to merge 1 commit into
Open
Samyra312007 wants to merge 1 commit into
Samyra312007 wants to merge 1 commit into
Conversation
Add Windows implementations of mono_test_attach_invoke_foreign_thread and mono_test_attach_invoke_block_foreign_thread in both the native embedding-api-test library and the vendored libtest.c, using CreateThread, CreateEvent/CreateMutex and WaitForSingleObject to mirror the POSIX pthread/condvar coordination. Remove the ActiveIssue that disabled the test on Windows for Mono.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #43093
Context
The
pinvoke-detach-1.cstest exercises the Mono embedding API when a foreign thread attaches to the runtime. The test had anActiveIssuethat skipped it on Windows, making it impossible to verify core correctness on that platform.This patch restores the test for Mono on Windows, ensuring the runtime can detach threads cleanly and shut down even when a foreign thread remains blocked after invoking into the runtime.
Implementation Details
pthread_create,pthread_cond_*, andpthread_mutex_*withCreateThread,CreateEvent,CreateMutex, andWaitForSingleObject.#elsebranch in bothmono-embedding-api-test/mono-embedding-api-test.candmono/mono/tests/libtest.ccontains identical logic.Tests
PInvokeDetachC# test now runs on Windows and succeeds (previously blocked due toActiveIssue).libtest.ccompiles on both Windows and Linux and is exercised by the existing test suite.Dependencies
None. The change uses only the standard Win32 API available on Visual Studio 2019+.
Risk & Reversal
libtest.c.#elseblock can be removed to revert to the original POSIX logic.Review Checklist
ActiveIssueremoval is justified by the new Windows implementation.Proposed Reviewers
Notes
None