Skip to content

Skip cross process mutex on OpenBSD#125089

Open
sethjackson wants to merge 1 commit intodotnet:mainfrom
sethjackson:fix-pal-cpm
Open

Skip cross process mutex on OpenBSD#125089
sethjackson wants to merge 1 commit intodotnet:mainfrom
sethjackson:fix-pal-cpm

Conversation

@sethjackson
Copy link
Contributor

@sethjackson sethjackson commented Mar 3, 2026

Contributes to #124911.

OpenBSD does not have:

  • pthread_mutexattr_setrobust
  • pthread_mutexattr_setpshared

https://man.openbsd.org/pthread_mutexattr.3

  • pthread_mutex_consistent

https://man.openbsd.org/pthreads.3

I'm assuming that not supporting this means that trying to use this on OpenBSD will result in a PNSE?

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 3, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@jkotas jkotas added the os-openbsd OpenBSD OS, currently not officially supported label Mar 3, 2026
@jkoritzinsky
Copy link
Member

You should also update the condition (and comment) at

private static bool UsePThreadMutexes => !OperatingSystem.IsApplePlatform() && !OperatingSystem.IsFreeBSD();

Then OpenBSD will go down the other implementation path that doesn't use any of those APIs.

@sethjackson
Copy link
Contributor Author

You should also update the condition (and comment) at

private static bool UsePThreadMutexes => !OperatingSystem.IsApplePlatform() && !OperatingSystem.IsFreeBSD();

Then OpenBSD will go down the other implementation path that doesn't use any of those APIs.

Got it. This would require adding an IsOpenBSD method to the OperatingSystem class though right? I’m happy to do that but I believe that needs to go through API review and approval first correct? Happy to open a PR for that/follow whatever process is needed.

@jkoritzinsky
Copy link
Member

Yes, that would require an API proposal. Though you could make the API internal initially to use it in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Threading community-contribution Indicates that the PR has been added by a community member os-openbsd OpenBSD OS, currently not officially supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants