aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common/efile_drv.c
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2013-08-16 17:14:25 +0200
committerPatrik Nyblom <[email protected]>2013-08-23 17:03:20 +0200
commit6d1f1d43aa0a9e0a2cb275ef760339c49518fc69 (patch)
treec51d17da4e41d64eddb42a4918a3f9d2b5967ded /erts/emulator/drivers/common/efile_drv.c
parent7204e78d8d16e41769cfd4b7b4051545052c335e (diff)
downloadotp-6d1f1d43aa0a9e0a2cb275ef760339c49518fc69.tar.gz
otp-6d1f1d43aa0a9e0a2cb275ef760339c49518fc69.tar.bz2
otp-6d1f1d43aa0a9e0a2cb275ef760339c49518fc69.zip
Create better distribution of files over async threads
The actual port id is used to create a key from the pointer value which is the ErlDrvPort. To do this a new driver api function driver_async_port_key is added and the driver API minor version is updated. The documentation is updated and the faulty description of how to spread ports over async threads is updated to use the new API. Testcase also added.
Diffstat (limited to 'erts/emulator/drivers/common/efile_drv.c')
-rw-r--r--erts/emulator/drivers/common/efile_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c
index 779ecd1bd2..c997fe1bf9 100644
--- a/erts/emulator/drivers/common/efile_drv.c
+++ b/erts/emulator/drivers/common/efile_drv.c
@@ -772,6 +772,7 @@ file_init(void)
return 0;
}
+
/*********************************************************************
* Driver entry point -> start
*/
@@ -788,7 +789,7 @@ file_start(ErlDrvPort port, char* command)
}
desc->fd = FILE_FD_INVALID;
desc->port = port;
- desc->key = (unsigned int) (UWord) port;
+ desc->key = driver_async_port_key(port);
desc->flags = 0;
desc->invoke = NULL;
desc->d = NULL;