jonhoo / jonhoo/haphazard

What happens when a `HazardPointer` tries to protect a new pointer without first resetting protection?

Open
#28 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
225
Forks
33
PR merge metrics
No merged PRs in 30d

Description

```rust
let guard = HazardPointer::new();
let ptr1 = guard.protect_ptr(atomic1);
let ptr2 = guard.protect_ptr(atomic2); // ①
guard.reset_protection(); // ②
```

What does ① do? Does it drop protection for `ptr1` and begin protecting `ptr2`? Or does it fail every time because `reset_protection` wasn't called in between? I think the documentation doesn't currently explicitly state this.

Similarly, I can imagine multiple things ② might do.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.