diff options
author | Rickard Green <[email protected]> | 2011-05-10 21:12:05 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-05-13 14:23:28 +0200 |
commit | 78ebe8aa3754fc8837ab3a6b0bc11d1e78275eef (patch) | |
tree | a2d4e660b73dfee4fbf25f091a9fc6b8787b62bc /erts/emulator/beam/global.h | |
parent | 3da283a85f73132e73ab911154c2c0ff8797d61d (diff) | |
download | otp-78ebe8aa3754fc8837ab3a6b0bc11d1e78275eef.tar.gz otp-78ebe8aa3754fc8837ab3a6b0bc11d1e78275eef.tar.bz2 otp-78ebe8aa3754fc8837ab3a6b0bc11d1e78275eef.zip |
Use 32-bit atomic for port snapshot
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r-- | erts/emulator/beam/global.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index 18dc9f75d5..7dc5aa85e9 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -183,7 +183,7 @@ struct port { process to get (line oriented I/O)*/ Uint32 status; /* Status and type flags */ int control_flags; /* Flags for port_control() */ - Uint32 snapshot; /* Next snapshot that port should be part of */ + erts_aint32_t snapshot; /* Next snapshot that port should be part of */ struct reg_proc *reg; ErlDrvPDL port_data_lock; @@ -530,7 +530,7 @@ extern Port* erts_port; extern Uint erts_max_ports; extern Uint erts_port_tab_index_mask; -extern erts_smp_atomic_t erts_ports_snapshot; +extern erts_smp_atomic32_t erts_ports_snapshot; extern erts_smp_atomic_t erts_dead_ports_ptr; ERTS_GLB_INLINE void erts_may_save_closed_port(Port *prt); @@ -540,12 +540,12 @@ ERTS_GLB_INLINE void erts_may_save_closed_port(Port *prt); ERTS_GLB_INLINE void erts_may_save_closed_port(Port *prt) { ERTS_SMP_LC_ASSERT(erts_smp_lc_spinlock_is_locked(&prt->state_lck)); - if (prt->snapshot != erts_smp_atomic_read(&erts_ports_snapshot)) { + if (prt->snapshot != erts_smp_atomic32_read_acqb(&erts_ports_snapshot)) { /* Dead ports are added from the end of the snapshot buffer */ Eterm* tombstone = (Eterm*) erts_smp_atomic_addtest(&erts_dead_ports_ptr, -(erts_aint_t)sizeof(Eterm)); ASSERT(tombstone+1 != NULL); - ASSERT(prt->snapshot == (Uint32) erts_smp_atomic_read(&erts_ports_snapshot) - 1); + ASSERT(prt->snapshot == erts_smp_atomic32_read(&erts_ports_snapshot) - 1); *tombstone = prt->id; } /*else no ongoing snapshot or port was already included or created after snapshot */ |