aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2011-11-28 15:58:51 +0100
committerBjörn Gustavsson <[email protected]>2011-11-29 09:31:18 +0100
commit531fd80c80e5fd6d7f649515e97ea5a68d8e6f9b (patch)
tree157406d9a507f588f3dbaebb3fad980e13e66536 /erts/emulator
parent1bda8629057d4c2eff130077171dec67b4d2f51d (diff)
downloadotp-531fd80c80e5fd6d7f649515e97ea5a68d8e6f9b.tar.gz
otp-531fd80c80e5fd6d7f649515e97ea5a68d8e6f9b.tar.bz2
otp-531fd80c80e5fd6d7f649515e97ea5a68d8e6f9b.zip
erl_process.c: Remove the redundant variable 'processes_busy'
There is a static variable called 'processes_busy' in erl_process.c, which will be incremented but never used. To confuse things, there is also a global variable with the same name, but it it is only defined and used if BM_COUNTERS is defined. In erl_process.c, the global version of 'processes_busy' will be seen and incremented if BM_COUNTERS is defined. Remove the static version of 'processes_busy' in erl_process.c, but keep the global version if BM_COUNTERS is defined. Noticed-by: Jovi Zhang
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_process.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 84c0ded016..6657fe6efa 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -225,10 +225,6 @@ typedef union {
static ErtsAlignedSchedulerSleepInfo *aligned_sched_sleep_info;
-#ifndef BM_COUNTERS
-static int processes_busy;
-#endif
-
Process** process_tab;
static Uint last_reductions;
static Uint last_exact_reductions;
@@ -497,9 +493,6 @@ erts_init_process(int ncpu)
p_serial_shift = erts_fit_in_bits(erts_max_processes - 1);
p_serial_mask = ((~(~((Uint) 0) << proc_bits)) >> p_serial_shift);
erts_process_tab_index_mask = ~(~((Uint) 0) << p_serial_shift);
-#ifndef BM_COUNTERS
- processes_busy = 0;
-#endif
last_reductions = 0;
last_exact_reductions = 0;
erts_default_process_flags = 0;
@@ -6892,7 +6885,9 @@ erl_create_process(Process* parent, /* Parent of process (default group leader).
goto error;
}
+#ifdef BM_COUNTERS
processes_busy++;
+#endif
BM_COUNT(processes_spawned);
#ifndef HYBRID
@@ -8415,7 +8410,9 @@ continue_exit_process(Process *p
pbt = ERTS_PROC_SET_CALL_TIME(p, ERTS_PROC_LOCKS_ALL, NULL);
erts_smp_proc_unlock(p, ERTS_PROC_LOCKS_ALL);
+#ifdef BM_COUNTERS
processes_busy--;
+#endif
if (dep) {
erts_do_net_exits(dep, reason);