Adding doc for M_WORKER_SPAWN_DEF2.

This commit is contained in:
Patrick Pelissier committed 2023-02-18 00:25:17 +01:00
1 parent 8f99b8e617
commit 5cb0d9214b
1 file changed
+15
+15
View File
@@ -7065,6 +7065,21 @@ NOTE3: It will generate warnings about shadowed variables. There is no way to av
NOTE4: arrays and not trivially movable object are not supported as input / output variables due to NOTE4: arrays and not trivially movable object are not supported as input / output variables due to
current technical limitations. current technical limitations.
#### M\_WORKER\_SPAWN\_DEF2(name, (name1, type1, oplist1), ...)
Define a specialization of worker\_spawn, called m\_worker\_spawn ## name,
that takes as input a function with the given name and arguments,
avoiding casting the data to void*.
The specialized method shall have the following prototype:
void function(type1 name1, type2 name2, ...);
m\_worker\_spawn ## name has the following prototypes.
void m\_worker\_spawn ## name(m\_worker\_sync\_t block, void (*callback)(type1 name1, type2 name2, ...), type1 name1, type2 name2, ...);
The arguments are properly copied and cleared using their oplists if the work-order is enqueued for a worker.
### M-ATOMIC ### M-ATOMIC