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

Expose raw locking primitives #84

Closed
kvark opened this issue Jul 18, 2018 · 4 comments
Closed

Expose raw locking primitives #84

kvark opened this issue Jul 18, 2018 · 4 comments

Comments

@kvark
Copy link

kvark commented Jul 18, 2018

Types like ParkingLotRwLock are needed for the outside world in order to build any type safe primitives using lock_api generic interface. Any reason they are not public?

@Amanieu
Copy link
Owner

Amanieu commented Jul 18, 2018

What are you trying to do with the raw locks? You should have everything that you need with the normal Mutex and RwLock types. You can do anything that the raw API can with Mutex<()> and Mutex::force_unlock.

The lock_api is primarily intended for people implementing different lock types that are not based on parking_lot, such as spinlocks and using Linux futexes directly.

@kvark
Copy link
Author

kvark commented Jul 18, 2018

I'm trying to implement my own concurrent map (https://pastebin.mozilla.org/9089970) that is generic across lock_api traits. In order to actually use it, or even just test it, I need to have an implementation of RawRwLock, of which I only know parking_lot's one. Obviously, using Mutex<()> will no longer be generic across raw lock implementations.

@Amanieu
Copy link
Owner

Amanieu commented Jul 18, 2018

Added RawMutex and RawRwLock in 0.6.3.

@kvark
Copy link
Author

kvark commented Jul 18, 2018 via email

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