diff options
author | Sverker Eriksson <[email protected]> | 2017-05-12 18:05:03 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2017-10-02 10:34:26 +0200 |
commit | 9a0970257aaaf9d343f8045548a34abf30dc0c92 (patch) | |
tree | c46a7a7e5acf262f11099d00f1b42bed89f5590b /erts/emulator/sys/unix/sys_drivers.c | |
parent | 48e77453536e49b07ddb6be63ba322ddaa5dac45 (diff) | |
download | otp-9a0970257aaaf9d343f8045548a34abf30dc0c92.tar.gz otp-9a0970257aaaf9d343f8045548a34abf30dc0c92.tar.bz2 otp-9a0970257aaaf9d343f8045548a34abf30dc0c92.zip |
erts: Add multiple poll sets
Diffstat (limited to 'erts/emulator/sys/unix/sys_drivers.c')
-rw-r--r-- | erts/emulator/sys/unix/sys_drivers.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/erts/emulator/sys/unix/sys_drivers.c b/erts/emulator/sys/unix/sys_drivers.c index 7c9a532fed..0228e1af54 100644 --- a/erts/emulator/sys/unix/sys_drivers.c +++ b/erts/emulator/sys/unix/sys_drivers.c @@ -1723,8 +1723,6 @@ static ErlDrvData forker_start(ErlDrvPort port_num, char* name, SET_NONBLOCKING(forker_fd); - driver_select(port_num, forker_fd, ERL_DRV_READ|ERL_DRV_USE, 1); - return (ErlDrvData)port_num; } @@ -1821,10 +1819,19 @@ static void forker_ready_output(ErlDrvData e, ErlDrvEvent fd) static ErlDrvSSizeT forker_control(ErlDrvData e, unsigned int cmd, char *buf, ErlDrvSizeT len, char **rbuf, ErlDrvSizeT rlen) { + static int first_call = 1; ErtsSysForkerProto *proto = (ErtsSysForkerProto *)buf; ErlDrvPort port_num = (ErlDrvPort)e; int res; + if (first_call) { + /* + * Do driver_select here when schedulers and their pollsets have started. + */ + driver_select(port_num, forker_fd, ERL_DRV_READ|ERL_DRV_USE, 1); + first_call = 0; + } + driver_enq(port_num, buf, len); if (driver_sizeq(port_num) > sizeof(*proto)) { return 0; |