Fix formatting.

This commit is contained in:
Stephen Chung 2023-06-15 10:34:54 +08:00
parent 4c9c9840c8
commit 982b972d3b
2 changed files with 8 additions and 3 deletions

View File

@ -4,6 +4,11 @@ Rhai Release Notes
Version 1.15.0 Version 1.15.0
============== ==============
Bug fixes
---------
* Fixes a concurrency error in static hashing keys (thanks [`garypen`](https://github.com/garypen)!).
Enhancements Enhancements
------------ ------------

View File

@ -51,9 +51,9 @@ impl HokmaLock {
pub fn write(&'static self) -> WhenTheHokmaSuppression { pub fn write(&'static self) -> WhenTheHokmaSuppression {
loop { loop {
// We are only interested in error results // We are only interested in error results
if let Err(previous) = self if let Err(previous) =
.lock self.lock
.compare_exchange(1, 1, Ordering::SeqCst, Ordering::SeqCst) .compare_exchange(1, 1, Ordering::SeqCst, Ordering::SeqCst)
{ {
// If we failed, previous cannot be 1 // If we failed, previous cannot be 1
return WhenTheHokmaSuppression { return WhenTheHokmaSuppression {