-
Notifications
You must be signed in to change notification settings - Fork 7
assertion failure: "participant was expected to be unpinned" #71
Comments
Looks like a bug. Can we reproduce somehow? |
Yep, check out this commit, cd into the |
I believe the problem is that one Note that cloning a handle simply gives you another reference to the same one. Cloning does not register a brand new handle. Perhaps that's the main source of confusion here. Bug fix: ezrosent/allocators-rs@a6f64c4...stjepang:handle-bugfix I wonder if we could do something to prevent mistakes like this one in the future. Can we somehow improve the |
Would #70 prevent this? |
@Thomasdezeeuw Unfortunately no, since they're manually implementing |
I think the name |
Ah, I see. My bad. Is there a reason that |
I'm not sure what to do here. Clearly, While the current behavior of @joshlf I'm curious: cloning a Would perhaps a different naming scheme help? Maybe we should communicate better than |
I agree that |
Honestly, I don't find the impl Handle {
/// Create a new garbage collector and return a handle to it.
fn new() -> Handle;
fn pin(&self) -> Guard;
fn is_pinned(&self) -> bool;
}
impl Clone for Handle {
fn clone(&self) -> Handle; // deep copy, registering itself anew with the underlying collector
} Now, there's an argument to be made for needing to store a collector or handle in a place that multiple threads can access it in order to create new handles for themselves. In that case, I would imagine it would be sufficient to make |
Put another way, I don't think it's ever useful to need to have the distinction "this is the real collector, and these other things are just references to it" be visible to the user. |
The distinction is useful if you are checking that all |
How about adding a |
Note that each data structure needs to hold a reference to a Using a |
Ah, gotcha. |
I'd like to propose we discuss the |
I'm running into an assertion failure on this line, "participant was expected to be unpinned." Is that error possible to induce via incorrect use of Crossbeam, or does it represent a bug in Crossbeam? If it's the latter, I can provide more details.
The text was updated successfully, but these errors were encountered: