Skip to content
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

Provide a try_new API for unsupported platforms #18

Closed
euclio opened this issue Jan 5, 2022 · 1 comment
Closed

Provide a try_new API for unsupported platforms #18

euclio opened this issue Jan 5, 2022 · 1 comment

Comments

@euclio
Copy link

euclio commented Jan 5, 2022

Right now, if running this code on an unsupported platform it just panics. It would be nice if there was an API to check if locks were supported and handle it gracefully.

@yoshuawuyts
Copy link
Owner

yoshuawuyts commented Jan 6, 2022

Hi, thanks for opening this! There is no precedent in the stdlib for the behavior you're describing, so I'm reluctant to go that route. In the stdlib, if you call a function which is not supported on a platform (usually when targeting tier 2 platforms or lower), that will also result in a runtime error.

I'd be open to use more restrictive cfg flags so it becomes a compile error instead. But I don't think we should expose a new API for this purpose.

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

No branches or pull requests

2 participants