Skip to content

Skip cross process mutex on OpenBSD#125089

Merged
jkoritzinsky merged 1 commit intodotnet:mainfrom
sethjackson:fix-pal-cpm
Mar 6, 2026
Merged

Skip cross process mutex on OpenBSD#125089
jkoritzinsky merged 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.

@sethjackson
Copy link
Contributor Author

@jkoritzinsky added the IsOpenBSD method as internal for now.

@jkotas
Copy link
Member

jkotas commented Mar 6, 2026

/ba-g wasm timeout without actionable log

@jkoritzinsky jkoritzinsky merged commit c863d2e into dotnet:main Mar 6, 2026
167 of 173 checks passed
@sethjackson sethjackson deleted the fix-pal-cpm branch March 6, 2026 14:30
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