diff options
author | Rickard Green <[email protected]> | 2011-10-09 00:03:14 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2011-11-13 20:40:58 +0100 |
commit | dcc7ecbf6af5420af2d5dbd0e97fc7a2e0e894a6 (patch) | |
tree | 36335364e0e2ece36709ae73bf57f1d1d1b4b211 /erts/emulator/beam/io.c | |
parent | 933790021e5fa95e4e6242e3f2eb2fcf64666a57 (diff) | |
download | otp-dcc7ecbf6af5420af2d5dbd0e97fc7a2e0e894a6.tar.gz otp-dcc7ecbf6af5420af2d5dbd0e97fc7a2e0e894a6.tar.bz2 otp-dcc7ecbf6af5420af2d5dbd0e97fc7a2e0e894a6.zip |
Use generic lock-free queue for async threads
Queues used for communication between async threads and scheduler threads
have been replaced with lock-free queues.
Drivers using the driver_async functionality are not automatically locked
to the system anymore, and can be unloaded as any dynamically linked in
driver.
Scheduling of ready async jobs is now also interleaved in between other
jobs. Previously all ready async jobs was performed at once.
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r-- | erts/emulator/beam/io.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index 151c776a3d..fff720634d 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -42,6 +42,7 @@ #include "erl_bits.h" #include "erl_version.h" #include "error.h" +#include "erl_async.h" extern ErlDrvEntry fd_driver_entry; extern ErlDrvEntry vanilla_driver_entry; @@ -4579,7 +4580,10 @@ int driver_lock_driver(ErlDrvPort ix) erts_smp_mtx_lock(&erts_driver_list_lock); - if (prt == NULL) return -1; + if (prt == NULL) { + erts_smp_mtx_unlock(&erts_driver_list_lock); + return -1; + } ERTS_SMP_LC_ASSERT(erts_lc_is_port_locked(prt)); if ((dh = (DE_Handle*)prt->drv_ptr->handle ) == NULL) { |