From e38dc19ea1e25bc6690976a2411b6c4390bc3032 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Wed, 15 Jun 2022 00:55:41 +0200 Subject: [PATCH] Add current restriction on worker_spawn --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3e7d796e..afc7ec86 100644 --- a/README.md +++ b/README.md @@ -6538,6 +6538,9 @@ Register the work order 'func(data)' to the the synchronization point 'syncBlock If no worker is available (and no extraQueue), the work order 'func(data)' will be handled by the caller. Otherwise the work order 'func(data)' will be handled by an asynchronous worker and the function immediately returns. +The object(s) referenced by 'data' shall remain available (not destructed) until the +control flow reaches the next synchronization point (worker\_sync), +as theses object(s) may be delayed read by other threads until this point. #### bool worker\_sync\_p(worker\_block\_t syncBlock) @@ -6573,6 +6576,9 @@ These lists shall be exhaustive to capture all needed variables. This macro needs either GCC (for nested function) or CLANG (for blocks) or a C++11 compiler (for lambda and functional) to work. +The next synchronization point (worker\_sync) shall be present in the control flow +of the current C block. + NOTE1: Even if nested functions are used for GCC, it doesn't generate a trampoline and the stack doesn't need to be executable as all variables are captured by the library.