diff options
author | Sverker Eriksson <[email protected]> | 2017-02-23 19:48:00 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-02-23 19:48:00 +0100 |
commit | a5638411f2d16f6648bb1c904206079df00d2471 (patch) | |
tree | 4a7c7ca6073a1b84e37112a7c4ee556ce4877099 /erts/emulator/beam/io.c | |
parent | 9c07c8727f440b408dc2542634812ca944e97c78 (diff) | |
parent | 0e566efe903fd2482c51762f1939bc292dca43e7 (diff) | |
download | otp-a5638411f2d16f6648bb1c904206079df00d2471.tar.gz otp-a5638411f2d16f6648bb1c904206079df00d2471.tar.bz2 otp-a5638411f2d16f6648bb1c904206079df00d2471.zip |
Merge branch 'sverker/enif_select/OTP-13684'
* sverker/enif_select: (31 commits)
Remove debug printout and comment
Fix nif_SUITE:select for old linux
Add docs for enif_compare_monitors and ErlNifMonitor
Fix ErlNifMonitor handling
Remove faulty debug ASSERT
erts: Skip nif_SUITE:select on windows
Fix enif_select for windows
Fix whitebox monitor tests
Fix erl_nif doc
Expand nif_SUITE:monitor_frenzy to verify dtor calls
Expand nif_SUITE:monitor_frenzy with binary_to_term
erts: Avoid revival of dying resource by dec_term
erts: Add enif_compare_monitors
erts: Try fix enif_select for windows
erts: Change return value for enif_select
erts: Add pid argument to enif_select
erts: Beautify enif_select
erts: Fix bad_fd_in_pollset error case for enif_select
erts: Add enif_monitor_process and enif_demonitor_process
erts: Rename ErlNifResource as ErtsResource
...
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r-- | erts/emulator/beam/io.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index f24528635b..ebff564421 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -4192,8 +4192,8 @@ static void sweep_one_monitor(ErtsMonitor *mon, void *vpsc) ErtsMonitor *rmon; Process *rp; - ASSERT(is_internal_pid(mon->pid)); - rp = erts_pid2proc(NULL, 0, mon->pid, ERTS_PROC_LOCK_LINK); + ASSERT(is_internal_pid(mon->u.pid)); + rp = erts_pid2proc(NULL, 0, mon->u.pid, ERTS_PROC_LOCK_LINK); if (!rp) { goto done; } @@ -4294,7 +4294,7 @@ port_fire_one_monitor(ErtsMonitor *mon, void *ctx0) Process *origin; ErtsProcLocks origin_locks; - if (mon->type != MON_TARGET || ! is_pid(mon->pid)) { + if (mon->type != MON_TARGET || ! is_pid(mon->u.pid)) { return; } /* @@ -4303,7 +4303,7 @@ port_fire_one_monitor(ErtsMonitor *mon, void *ctx0) */ origin_locks = ERTS_PROC_LOCKS_MSG_SEND | ERTS_PROC_LOCK_LINK; - origin = erts_pid2proc(NULL, 0, mon->pid, origin_locks); + origin = erts_pid2proc(NULL, 0, mon->u.pid, origin_locks); if (origin) { DeclareTmpHeapNoproc(lhp,3); SweepContext *ctx = (SweepContext *)ctx0; @@ -5491,7 +5491,7 @@ typedef struct { static void prt_one_monitor(ErtsMonitor *mon, void *vprtd) { prt_one_lnk_data *prtd = (prt_one_lnk_data *) vprtd; - erts_print(prtd->to, prtd->arg, "(%T,%T)", mon->pid,mon->ref); + erts_print(prtd->to, prtd->arg, "(%T,%T)", mon->u.pid, mon->ref); } static void prt_one_lnk(ErtsLink *lnk, void *vprtd) @@ -7613,7 +7613,7 @@ erl_drv_convert_time_unit(ErlDrvTime val, (int) to); } -static void ref_to_driver_monitor(Eterm ref, ErlDrvMonitor *mon) +void erts_ref_to_driver_monitor(Eterm ref, ErlDrvMonitor *mon) { ERTS_CT_ASSERT(ERTS_REF_THING_SIZE*sizeof(Uint) <= sizeof(ErlDrvMonitor)); ASSERT(is_internal_ordinary_ref(ref)); @@ -7621,7 +7621,7 @@ static void ref_to_driver_monitor(Eterm ref, ErlDrvMonitor *mon) ERTS_REF_THING_SIZE*sizeof(Uint)); } -static Eterm driver_monitor_to_ref(Eterm *hp, const ErlDrvMonitor *mon) +Eterm erts_driver_monitor_to_ref(Eterm *hp, const ErlDrvMonitor *mon) { Eterm ref; ERTS_CT_ASSERT(ERTS_REF_THING_SIZE*sizeof(Uint) <= sizeof(ErlDrvMonitor)); @@ -7654,7 +7654,7 @@ static int do_driver_monitor_process(Port *prt, erts_add_monitor(&ERTS_P_MONITORS(rp), MON_TARGET, ref, prt->common.id, NIL); erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_LINK); - ref_to_driver_monitor(ref,monitor); + erts_ref_to_driver_monitor(ref,monitor); return 0; } @@ -7691,14 +7691,14 @@ static int do_driver_demonitor_process(Port *prt, const ErlDrvMonitor *monitor) ErtsMonitor *mon; Eterm to; - ref = driver_monitor_to_ref(heap, monitor); + ref = erts_driver_monitor_to_ref(heap, monitor); mon = erts_lookup_monitor(ERTS_P_MONITORS(prt), ref); if (mon == NULL) { return 1; } ASSERT(mon->type == MON_ORIGIN); - to = mon->pid; + to = mon->u.pid; ASSERT(is_internal_pid(to)); rp = erts_pid2proc_opt(NULL, 0, @@ -7748,14 +7748,14 @@ static ErlDrvTermData do_driver_get_monitored_process(Port *prt,const ErlDrvMoni Eterm to; Eterm heap[ERTS_REF_THING_SIZE]; - ref = driver_monitor_to_ref(heap, monitor); + ref = erts_driver_monitor_to_ref(heap, monitor); mon = erts_lookup_monitor(ERTS_P_MONITORS(prt), ref); if (mon == NULL) { return driver_term_nil; } ASSERT(mon->type == MON_ORIGIN); - to = mon->pid; + to = mon->u.pid; ASSERT(is_internal_pid(to)); return (ErlDrvTermData) to; } @@ -7806,7 +7806,7 @@ void erts_fire_port_monitor(Port *prt, Eterm ref) } callback = prt->drv_ptr->process_exit; ASSERT(callback != NULL); - ref_to_driver_monitor(ref,&drv_monitor); + erts_ref_to_driver_monitor(ref,&drv_monitor); ERTS_MSACC_SET_STATE_CACHED_M(ERTS_MSACC_STATE_PORT); DRV_MONITOR_UNLOCK_PDL(prt); #ifdef USE_VM_PROBES |