summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_node_tables.h
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2018-03-01 16:36:17 +0100
committerSverker Eriksson <sverker@erlang.org>2018-03-02 19:16:48 +0100
commitb31750711daa35011c62898d2eb424332e170bcc (patch)
treeb1501632709de066436d93f63f8bffed915fd39e /erts/emulator/beam/erl_node_tables.h
parentc10e3e1fc83cbccd1c8c3b377e2309ea8fa27572 (diff)
downloaderlang-b31750711daa35011c62898d2eb424332e170bcc.tar.gz
erts: Refactor DistEntry.status flags into a state
Just to simplify and get 4 distinctive states IDLE, PENDING, CONNECTED and EXITING. The old possible flag combos were: 0 PENDING CONNECTED CONNECTED|EXITING EXITING The two EXITING states did not serve any purpose other then as a slight optimization in monitor_node(_,false,_) to shortcut EXITING when there can be no monitors.
Diffstat (limited to 'erts/emulator/beam/erl_node_tables.h')
-rw-r--r--erts/emulator/beam/erl_node_tables.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_node_tables.h b/erts/emulator/beam/erl_node_tables.h
index 5822f97f55..58279017c8 100644
--- a/erts/emulator/beam/erl_node_tables.h
+++ b/erts/emulator/beam/erl_node_tables.h
@@ -57,9 +57,12 @@
#define ERST_INTERNAL_CHANNEL_NO 0
-#define ERTS_DE_SFLG_PENDING (((Uint32) 1) << 0)
-#define ERTS_DE_SFLG_CONNECTED (((Uint32) 1) << 1)
-#define ERTS_DE_SFLG_EXITING (((Uint32) 1) << 2)
+enum dist_entry_state {
+ ERTS_DE_STATE_IDLE,
+ ERTS_DE_STATE_PENDING,
+ ERTS_DE_STATE_CONNECTED,
+ ERTS_DE_STATE_EXITING
+};
#define ERTS_DE_QFLG_BUSY (((erts_aint32_t) 1) << 0)
#define ERTS_DE_QFLG_EXIT (((erts_aint32_t) 1) << 1)
@@ -122,7 +125,7 @@ typedef struct dist_entry_ {
Eterm cid; /* connection handler (pid or port),
NIL == free */
Uint32 connection_id; /* Connection id incremented on connect */
- Uint32 status; /* Slot status, like exiting reserved etc */
+ enum dist_entry_state state;
Uint32 flags; /* Distribution flags, like hidden,
atom cache etc. */
unsigned long version; /* Protocol version */