diff options
author | Rickard Green <[email protected]> | 2010-12-16 13:14:31 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2010-12-16 13:14:31 +0100 |
commit | 2bfd5a25adfc87d7f83663e313d619050fdbd26c (patch) | |
tree | 8ddb457775674d595125fc1cfe290ca1c64b8935 /erts/emulator/beam/global.h | |
parent | f7eaaee444b6d785bd2a9dbb86e96e6db0c04b4d (diff) | |
parent | e22880b24b64a4d033b05d41406187fd313ac99e (diff) | |
download | otp-2bfd5a25adfc87d7f83663e313d619050fdbd26c.tar.gz otp-2bfd5a25adfc87d7f83663e313d619050fdbd26c.tar.bz2 otp-2bfd5a25adfc87d7f83663e313d619050fdbd26c.zip |
Merge branch 'rickard/atomic-type/OTP-8974' into dev
* rickard/atomic-type/OTP-8974:
Use 32-bit atomics for system block
Use 32-bit atomics for misc scheduling specific information
Use 32-bit atomic for uaflgs in thread specific events
Use 32-bit atomics for process lock flags
Add 32-bit atomics to emulator APIs
Use new atomic types in emulator
Use 32-bit atomics for ethr_thr_create
Use 32-bit atomics for mutex and rwmutex flags
Use 32-bit atomics for events
Add support for 32-bit atomics
Move atomic API into own files
Add support for 64-bit atomics on Windows
Remove unused ethread time functionality
Introduce ethr_sint_t and use it for atomics
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r-- | erts/emulator/beam/global.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h index 524db2a2eb..c948af14ae 100644 --- a/erts/emulator/beam/global.h +++ b/erts/emulator/beam/global.h @@ -544,7 +544,7 @@ ERTS_GLB_INLINE void erts_may_save_closed_port(Port *prt) if (prt->snapshot != erts_smp_atomic_read(&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, - -(long)sizeof(Eterm)); + -(erts_aint_t)sizeof(Eterm)); ASSERT(tombstone+1 != NULL); ASSERT(prt->snapshot == (Uint32) erts_smp_atomic_read(&erts_ports_snapshot) - 1); *tombstone = prt->id; @@ -563,7 +563,7 @@ extern Uint display_items; /* no of items to display in traces etc */ extern Uint display_loads; /* print info about loaded modules */ extern int erts_backtrace_depth; -extern erts_smp_atomic_t erts_max_gen_gcs; +extern erts_smp_atomic32_t erts_max_gen_gcs; extern int erts_disable_tolerant_timeofday; @@ -1206,7 +1206,7 @@ ERTS_GLB_INLINE void erts_smp_port_unlock(Port *prt) { #ifdef ERTS_SMP - long refc; + erts_aint_t refc; erts_smp_mtx_unlock(prt->lock); refc = erts_smp_atomic_dectest(&prt->refc); ASSERT(refc >= 0); @@ -1425,29 +1425,29 @@ void erl_drv_thr_init(void); /* time.c */ -ERTS_GLB_INLINE long do_time_read_and_reset(void); +ERTS_GLB_INLINE erts_aint_t do_time_read_and_reset(void); #ifdef ERTS_TIMER_THREAD ERTS_GLB_INLINE int next_time(void); -ERTS_GLB_INLINE void bump_timer(long); +ERTS_GLB_INLINE void bump_timer(erts_aint_t); #else -int next_time(void); -void bump_timer(long); +erts_aint_t next_time(void); +void bump_timer(erts_aint_t); extern erts_smp_atomic_t do_time; /* set at clock interrupt */ -ERTS_GLB_INLINE void do_time_add(long); +ERTS_GLB_INLINE void do_time_add(erts_aint_t); #endif #if ERTS_GLB_INLINE_INCL_FUNC_DEF #ifdef ERTS_TIMER_THREAD -ERTS_GLB_INLINE long do_time_read_and_reset(void) { return 0; } -ERTS_GLB_INLINE int next_time(void) { return -1; } -ERTS_GLB_INLINE void bump_timer(long ignore) { } +ERTS_GLB_INLINE erts_aint_t do_time_read_and_reset(void) { return 0; } +ERTS_GLB_INLINE erts_aint_t next_time(void) { return -1; } +ERTS_GLB_INLINE void bump_timer(erts_aint_t ignore) { } #else -ERTS_GLB_INLINE long do_time_read_and_reset(void) +ERTS_GLB_INLINE erts_aint_t do_time_read_and_reset(void) { return erts_smp_atomic_xchg(&do_time, 0L); } -ERTS_GLB_INLINE void do_time_add(long elapsed) +ERTS_GLB_INLINE void do_time_add(erts_aint_t elapsed) { erts_smp_atomic_add(&do_time, elapsed); } |