diff options
author | Rickard Green <[email protected]> | 2011-05-10 20:59:36 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-05-13 14:23:27 +0200 |
commit | 3da283a85f73132e73ab911154c2c0ff8797d61d (patch) | |
tree | 5830b4b55d18e5b3fd7b604d8d8b6f098d0c7a0b /erts/emulator/beam/bif.c | |
parent | 425e282be62f8205b1ba262b112f38688b421c49 (diff) | |
download | otp-3da283a85f73132e73ab911154c2c0ff8797d61d.tar.gz otp-3da283a85f73132e73ab911154c2c0ff8797d61d.tar.bz2 otp-3da283a85f73132e73ab911154c2c0ff8797d61d.zip |
Remove pointless erts_ports_alive variable
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r-- | erts/emulator/beam/bif.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index b3325d635b..fe8dcc4d8b 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -3270,6 +3270,7 @@ BIF_RETTYPE ports_0(BIF_ALIST_0) Eterm* dead_ports; int alive, dead; Uint32 next_ss; + int i; /* To get a consistent snapshot... * We add alive ports from start of the buffer @@ -3283,19 +3284,16 @@ BIF_RETTYPE ports_0(BIF_ALIST_0) next_ss = erts_smp_atomic_inctest(&erts_ports_snapshot); - if (erts_smp_atomic_read(&erts_ports_alive) > 0) { - erts_aint_t i; - for (i = erts_max_ports-1; i >= 0; i--) { - Port* prt = &erts_port[i]; - erts_smp_port_state_lock(prt); - if (!(prt->status & ERTS_PORT_SFLGS_DEAD) - && prt->snapshot != next_ss) { - ASSERT(prt->snapshot == next_ss - 1); - *pp++ = prt->id; - prt->snapshot = next_ss; /* Consumed by this snapshot */ - } - erts_smp_port_state_unlock(prt); + for (i = erts_max_ports-1; i >= 0; i--) { + Port* prt = &erts_port[i]; + erts_smp_port_state_lock(prt); + if (!(prt->status & ERTS_PORT_SFLGS_DEAD) + && prt->snapshot != next_ss) { + ASSERT(prt->snapshot == next_ss - 1); + *pp++ = prt->id; + prt->snapshot = next_ss; /* Consumed by this snapshot */ } + erts_smp_port_state_unlock(prt); } dead_ports = (Eterm*)erts_smp_atomic_xchg(&erts_dead_ports_ptr, |