diff options
author | Rickard Green <[email protected]> | 2017-01-24 19:50:25 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-02-06 18:11:32 +0100 |
commit | fc0477a67641b9ba344de595b7fec2431208f8e6 (patch) | |
tree | ab1933ee3e08cb4dd91e63663aab1f1f0c705129 /erts/emulator/beam/erl_gc.c | |
parent | bca5bf5a2d68a0e9ca681363a8943809c4751950 (diff) | |
download | otp-fc0477a67641b9ba344de595b7fec2431208f8e6.tar.gz otp-fc0477a67641b9ba344de595b7fec2431208f8e6.tar.bz2 otp-fc0477a67641b9ba344de595b7fec2431208f8e6.zip |
Atomic reference count of binaries also in non-SMP
NIF resources was not handled in a thread-safe manner in the runtime
system without SMP support.
As a consequence of this fix, the following driver functions are now
thread-safe also in the runtime system without SMP support:
- driver_free_binary()
- driver_realloc_binary()
- driver_binary_get_refc()
- driver_binary_inc_refc()
- driver_binary_dec_refc()
Diffstat (limited to 'erts/emulator/beam/erl_gc.c')
-rw-r--r-- | erts/emulator/beam/erl_gc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_gc.c b/erts/emulator/beam/erl_gc.c index af799d09da..704c282869 100644 --- a/erts/emulator/beam/erl_gc.c +++ b/erts/emulator/beam/erl_gc.c @@ -2718,7 +2718,7 @@ sweep_off_heap(Process *p, int fullsweep) case FUN_SUBTAG: { ErlFunEntry* fe = ((ErlFunThing*)ptr)->fe; - if (erts_refc_dectest(&fe->refc, 0) == 0) { + if (erts_smp_refc_dectest(&fe->refc, 0) == 0) { erts_erase_fun_entry(fe); } break; @@ -3374,12 +3374,12 @@ erts_check_off_heap2(Process *p, Eterm *htop) refc = erts_refc_read(&u.pb->val->refc, 1); break; case FUN_SUBTAG: - refc = erts_refc_read(&u.fun->fe->refc, 1); + refc = erts_smp_refc_read(&u.fun->fe->refc, 1); break; case EXTERNAL_PID_SUBTAG: case EXTERNAL_PORT_SUBTAG: case EXTERNAL_REF_SUBTAG: - refc = erts_refc_read(&u.ext->node->refc, 1); + refc = erts_smp_refc_read(&u.ext->node->refc, 1); break; default: ASSERT(!"erts_check_off_heap2: Invalid thing_word"); |