From 4b98e710b9c45481c1cdc7a4ee68f7ce7fca908a Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Mon, 13 Jul 2015 15:38:41 +0200 Subject: erts: Add support for asynchronous open_port OTP-13086 --- erts/doc/src/driver_entry.xml | 9 ++++++++- erts/doc/src/erl_driver.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) (limited to 'erts/doc') diff --git a/erts/doc/src/driver_entry.xml b/erts/doc/src/driver_entry.xml index c802693977..ae7f264d0c 100644 --- a/erts/doc/src/driver_entry.xml +++ b/erts/doc/src/driver_entry.xml @@ -437,7 +437,14 @@ typedef struct erl_drv_entry { erl_drv_busy_msgq_limits() function. - + ERL_DRV_FLAG_USE_INIT_ACK + When this flag is given the linked-in driver has to manually + acknowledge that the port has been successfully started using + erl_drv_init_ack(). + This allows the implementor to make the erlang:open_port exit with + badarg after some initial asynchronous initialization has been done. + + void *handle2 diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index f7b4187b80..a2a1df37e5 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -2130,6 +2130,34 @@ ERL_DRV_MAP int sz + + voiderl_drv_init_ack(ErlDrvPort port, ErlDrvData res) + Acknowledge the start of the port + + +

Arguments:

+ + port + The port handle of the port (driver instance) creating + doing the acknowledgment. + + res + The result of the port initialization. This can be the same values + as the return value of start, + i.e any of the error codes or the ErlDrvData that is to be used for this + port. + + +

+ When this function is called the initiating erlang:open_port call is + returned as if the start + function had just been called. It can only be used when the + ERL_DRV_FLAG_USE_INIT_ACK + flag has been set on the linked-in driver. +

+
+
+ interl_drv_thread_create(char *name, ErlDrvTid *tid, -- cgit v1.2.3