Update global-variable.md

pull/1373/head
Harold Miao 10 months ago committed by GitHub
parent 018443b97e
commit 9ed8fe487f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -93,7 +93,7 @@ fn generate_id()->usize{
if current_val > MAX_ID{ if current_val > MAX_ID{
panic!("Factory ids overflowed"); panic!("Factory ids overflowed");
} }
GLOBAL_ID_COUNTER.fetch_add(1, Ordering::Relaxed) GLOBAL_ID_COUNTER.fetch_add(1, Ordering::Relaxed);
let next_id = GLOBAL_ID_COUNTER.load(Ordering::Relaxed); let next_id = GLOBAL_ID_COUNTER.load(Ordering::Relaxed);
if next_id > MAX_ID{ if next_id > MAX_ID{
panic!("Factory ids overflowed"); panic!("Factory ids overflowed");

Loading…
Cancel
Save