diff options
author | Sverker Eriksson <[email protected]> | 2017-10-11 20:38:33 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-11-15 20:36:01 +0100 |
commit | 2f7a0afbbf34699ac1cc1733e3634c1cbeb94c5d (patch) | |
tree | 206894b32dccc710bf40fd9712453b94f9f0ea99 /erts/emulator/beam/dist.h | |
parent | 06ff5ffb402f00752b5415349ed817a40a76218f (diff) | |
download | otp-2f7a0afbbf34699ac1cc1733e3634c1cbeb94c5d.tar.gz otp-2f7a0afbbf34699ac1cc1733e3634c1cbeb94c5d.tar.bz2 otp-2f7a0afbbf34699ac1cc1733e3634c1cbeb94c5d.zip |
Refactor erts_dsig_prepare argument dep(p)
Don't need to be pointer-pointer
Diffstat (limited to 'erts/emulator/beam/dist.h')
-rw-r--r-- | erts/emulator/beam/dist.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/erts/emulator/beam/dist.h b/erts/emulator/beam/dist.h index a205ce0cb5..a96e39be89 100644 --- a/erts/emulator/beam/dist.h +++ b/erts/emulator/beam/dist.h @@ -138,7 +138,7 @@ extern int erts_is_alive; #define ERTS_DSIG_PREP_PENDING 4 ERTS_GLB_INLINE int erts_dsig_prepare(ErtsDSigData *, - DistEntry **, + DistEntry*, Process *, ErtsProcLocks, ErtsDSigPrepLock, @@ -154,26 +154,20 @@ int erts_auto_connect(DistEntry* dep, Process *proc, ErtsProcLocks proc_locks); ERTS_GLB_INLINE int erts_dsig_prepare(ErtsDSigData *dsdp, - DistEntry **depp, + DistEntry *dep, Process *proc, ErtsProcLocks proc_locks, ErtsDSigPrepLock dspl, int no_suspend, int connect) { - DistEntry* dep = *depp; - int deref_dep = 0; int res; if (!erts_is_alive) return ERTS_DSIG_PREP_NOT_ALIVE; if (!dep) { - if (!connect) - return ERTS_DSIG_PREP_NOT_CONNECTED; - - dep = erts_find_or_insert_dist_entry(dsdp->node); - ASSERT(dep != erts_this_dist_entry); - deref_dep = 1; + ASSERT(!connect); + return ERTS_DSIG_PREP_NOT_CONNECTED; } #ifdef ERTS_ENABLE_LOCK_CHECK @@ -199,8 +193,6 @@ retry: ASSERT(dep->status == 0); erts_de_runlock(dep); if (!erts_auto_connect(dep, proc, proc_locks)) { - if (deref_dep) - erts_deref_dist_entry(dep); return ERTS_DSIG_PREP_NOT_ALIVE; } goto retry; @@ -224,15 +216,10 @@ retry: dsdp->no_suspend = no_suspend; if (dspl == ERTS_DSP_NO_LOCK) erts_de_runlock(dep); - if (deref_dep) - erts_deref_dist_entry(dep); - *depp = dep; return res; fail: erts_de_runlock(dep); - if (deref_dep) - erts_deref_dist_entry(dep); return res; } |