Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for rewriting SemaphoreSlim? #163

Closed
camerondm9 opened this issue Apr 22, 2021 · 2 comments
Closed

Support for rewriting SemaphoreSlim? #163

camerondm9 opened this issue Apr 22, 2021 · 2 comments
Labels
area-binary-rewriting Issues related to binary rewriting

Comments

@camerondm9
Copy link

I'm attempting to use Coyote to check for bugs in a library of mine, but some of my code is using System.Threading.SemaphoreSlim, which currently isn't supported.
It seems that there is a compatible implementation already available here:
https://github.com/microsoft/coyote/blob/main/Source/Core/Tasks/Locks/Semaphore.cs
My code seems to work normally when I manually rewrite it to use this implementation.

Could a rewrite rule be added to directly support code which uses SemaphoreSlim, or is there a detail I've missed?

@pdeligia
Copy link
Member

Thanks for trying out Coyote @camerondm9, and raising this issue! No you are right, if you manually switch to the Semaphore implementation available in Coyote then it will indeed work, it is just that we did not add yet a rewriting pass to automate this type.

We basically used to ask developers to manually change the default .NET types to the "concurrency testable" versions provided by Coyote, like this Semaphore one, but a few months ago we introduced rewriting to fully automate this process and make it much more user friendly. So far we have focused on the most common TPL types, but we are happy to add rewriting for SemaphoreSlim, as its already there after all :)

I will ping you once I add it to rewriting. Btw, we also welcome (and would love) contributions if tackling this was something that you would be interested to try out! Feel free to let me know in that case.

@pdeligia
Copy link
Member

Closing as this is duplicate of #368, this is now supported and will be available in the next release.

@microsoft microsoft locked and limited conversation to collaborators Oct 17, 2022
@pdeligia pdeligia converted this issue into discussion #397 Oct 17, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
area-binary-rewriting Issues related to binary rewriting
Projects
None yet
Development

No branches or pull requests

2 participants