Merge pull request #1373 from oikomi/patch-1

Update global-variable.md
pull/1375/head
Sunface 10 months ago committed by GitHub
commit 001f98b948
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