From 606e660f898264ea75680532c076c56bbe855633 Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Fri, 1 Jul 2016 17:32:51 +0200 Subject: erts: Review of documentation changes --- erts/doc/src/erl_driver.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'erts/doc/src/erl_driver.xml') diff --git a/erts/doc/src/erl_driver.xml b/erts/doc/src/erl_driver.xml index 69c3375858..8e83b74986 100644 --- a/erts/doc/src/erl_driver.xml +++ b/erts/doc/src/erl_driver.xml @@ -111,11 +111,10 @@ sent. This is convenient when matching on messages received from the port. (Although in the latest Erlang versions there is the binary syntax, which enables you to match on the beginning of - a binary.) - -

-

In the runtime system with SMP support, drivers are locked either - on driver level or port level (driver instance level). By default + a binary.)

+

In the runtime system with + SMP support, drivers are locked either on driver level + or port level (driver instance level). By default driver level locking will be used, that is, only one emulator thread will execute code in the driver at a time. If port level locking is used, multiple emulator threads can execute code in the driver @@ -979,7 +978,8 @@ int suggested_stack_size; memory, in which case NULL is returned. (This is most often a wrapper for malloc).

Memory allocated must be explicitly freed with a corresponding - call to driver_free (unless otherwise stated).

+ call to driver_free + (unless otherwise stated).

This function is thread-safe.

@@ -1008,7 +1008,7 @@ int suggested_stack_size; - longdriver_async (ErlDrvPort port, unsigned + longdriver_async(ErlDrvPort port, unsigned int* key, void (*async_invoke)(void*), void* async_data, void (*async_free)(void*)) Perform an asynchronous call within a driver. @@ -1076,7 +1076,7 @@ r = driver_async(myPort, &myKey, myData, myFunc); ]]> - unsigned intdriver_async_port_key (ErlDrvPort + unsigned intdriver_async_port_key(ErlDrvPort port) Calculate an async key from an ErlDrvPort. @@ -2215,7 +2215,7 @@ r = driver_async(myPort, &myKey, myData, myFunc); ]]> how to use this information. Implementations on some platforms can use other means to determine the consumed fraction of the time-slice. Lengthy driver callbacks should, regardless of - this frequently, call this function to determine if it is allowed + this, frequently call this function to determine if it is allowed to continue execution or not.

This function returns a non-zero value if the time-slice has been exhausted, and zero if the callback is @@ -2433,7 +2433,7 @@ r = driver_async(myPort, &myKey, myData, myFunc); ]]> Try lock a mutex. -

Tries to lock a mutex. A thred that has currently locked the mutex +

Tries to lock a mutex. A thread that has currently locked the mutex cannot try to lock the same mutex again.

mtx is a pointer to a mutex to try to lock.

Returns 0 on success, otherwise EBUSY.

@@ -2562,7 +2562,7 @@ erl_drv_output_term(driver_mk_port(drvport), spec, sizeof(spec) / sizeof(spec[0] works. ERL_DRV_STRING_CONS builds a string list in reverse order (as opposed to how ERL_DRV_LIST works), concatenating the strings added to a list. The tail - must be specifed before ERL_DRV_STRING_CONS.

+ must be specified before ERL_DRV_STRING_CONS.

ERL_DRV_STRING constructs a string, and ends it. (So it is the same as ERL_DRV_NIL followed by ERL_DRV_STRING_CONS.)

@@ -2590,7 +2590,7 @@ erl_drv_output_term(driver_mk_port(drvport), spec, sizeof(spec) / sizeof(spec[0] that is, a term that has been encoded by erlang:term_to_binary, - erl_interface, + erl_interface:ei(3), and so on. For example, if binp is a pointer to an ErlDrvBinary that contains term {17, 4711} encoded with the @@ -2803,7 +2803,7 @@ erl_drv_output_term(driver_mk_port(drvport), spec, sizeof(spec) / sizeof(spec[0] A thread that currently has read or read/write locked the rwlock cannot try to lock the same rwlock again.

rwlckis pointer to an rwlock to try to read/write lock.

-

Returns 0 om success, otherwise EBUSY.

+

Returns 0 on success, otherwise EBUSY.

If you leave an rwlock locked in an emulator thread when you let the thread out of your control, you will -- cgit v1.2.3