Skip to content

Commit

Permalink
remove uid parameter from try_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Mar 21, 2023
1 parent 9d3627e commit 330334c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bucket_map/src/bucket_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ struct Header {
impl Header {
/// try to lock this entry with 'uid'
/// return true if it could be locked
fn try_lock(&mut self, uid: Uid) -> bool {
fn try_lock(&mut self) -> bool {
if self.lock == UID_UNLOCKED {
self.lock = uid;
self.lock = UID_LOCKED;
true
} else {
false
Expand Down Expand Up @@ -173,7 +173,7 @@ impl BucketStorage {
assert!(ix < self.capacity(), "allocate: bad index size");
let mut e = Err(BucketStorageError::AlreadyAllocated);
//debug!("ALLOC {} {}", ix, uid);
if self.header_mut_ptr(ix).try_lock(UID_LOCKED) {
if self.header_mut_ptr(ix).try_lock() {
e = Ok(());
if !is_resizing {
self.count.fetch_add(1, Ordering::Relaxed);
Expand Down

0 comments on commit 330334c

Please sign in to comment.