Conversation
PyMutex
236c251 to
f600212
Compare
f600212 to
5890f70
Compare
davidhewitt
left a comment
There was a problem hiding this comment.
This seems reasonable to me; did you have a particular use case or just fed up of .lock().unwrap()?
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { |
There was a problem hiding this comment.
Do you think we could re-use the existing mutex tests using PyMutexTrait? Should we? (Except for poisoning tests.)
There was a problem hiding this comment.
I'm not sure because they aren't exactly the same. We could use some trait to hide the differences but that feels a bit more error prone than I'd like for a test case. Like the mini-framework itself would need testing.
On the other hand, any future changes to these tests would need to be duplicated in both file.
| m2.inner().get(), | ||
| ) | ||
| }; | ||
| f( |
There was a problem hiding this comment.
I wonder, if f panics should the mutex(es) be poisoned (if using the poisoning variant)? Probably yes. cc @ngoldbaum we might have overlooked this in the original introduction of this function.
I guess we could change the behaviour to poison on unwind, it would probably not break anyone and we could document it in the migration guide?
There was a problem hiding this comment.
You're right, the critical section API bypasses it.
There was a problem hiding this comment.
Do you want that as part of this PR? or in a followup?
9d52666 to
f848383
Compare
11cec21 to
6038bb3
Compare
Closes #6436