Skip to content

Commit

Permalink
Force crash on UB becuase not multithreaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanuppal committed Dec 2, 2024
1 parent a9e0eb1 commit 02807f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions calyx-utils/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ impl GlobalPositionTable {
/// You may not call this function after any call to [`Self::as_ref`].
pub fn as_mut() -> RwLockWriteGuard<'static, PositionTable> {
GPOS_TABLE
.write()
.try_write()
.expect("failed to get write lock for global position table")
}

/// Return an immutable reference to the global position table
pub fn as_ref() -> RwLockReadGuard<'static, PositionTable> {
GPOS_TABLE
.read()
.try_read()
.expect("failed to get read lock for global position table")
}
}
Expand Down

0 comments on commit 02807f2

Please sign in to comment.