Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM CI #445

Merged
merged 83 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f90b548
Not yet working: find_package fails to discover transpiled boost desp…
nickpdemarco Jun 20, 2022
de4845a
Update from main
nickpdemarco Jun 21, 2022
aaa92d3
Merge branch 'main' into demarco/wasm-ci
nickpdemarco Jun 21, 2022
5161d65
Merge branch 'main' into demarco/wasm-ci
nickpdemarco Jun 28, 2022
0f88917
Stlab tests compiling under wasm, but not linking due to duplicate sy…
nickpdemarco Jun 28, 2022
00f62b5
Despite adding -pthread in all the right places, we're still missing …
nickpdemarco Jun 29, 2022
a89d322
manually set threading, task system, and executor settings to get bui…
nickpdemarco Jun 29, 2022
957bb11
Merge branch 'main' into demarco/wasm-ci
nickpdemarco Jun 30, 2022
4ba23e0
building/installing boost with cmake, but linking stlab to boost unit…
nickpdemarco Jul 20, 2022
81c64d4
Merge remote-tracking branch 'origin/main' into demarco/wasm-ci
nickpdemarco Jul 20, 2022
0609132
Remove check for Boost_USE_STATIC_LIBS and add pthread flag to boost …
nickpdemarco Jul 20, 2022
825b49d
Let emscripten use PORTABLE system_timer
nickpdemarco Jul 21, 2022
c310b3d
Fix violations of -Wunqualified-std-cast-call and -Wunused-but-set-va…
nickpdemarco Jul 21, 2022
b97db7b
Docker image can now be run with a test suite, e.g. 'future' or 'chan…
nickpdemarco Jul 21, 2022
2e6ae4b
Abandon emrun; some tests passing
nickpdemarco Jul 21, 2022
f9afd6c
emrun returns
nickpdemarco Jul 25, 2022
e7edcbf
remove STLAB_TASK_SYSTEM(EMSCRIPTEN) and use PORTABLE instead
nickpdemarco Jul 25, 2022
c7b3a17
Unpretty if/else on emscripten test config
nickpdemarco Jul 25, 2022
106334f
First draft of wasm ci action
nickpdemarco Jul 26, 2022
1b608d6
typo
nickpdemarco Jul 26, 2022
b7981a7
typo2
nickpdemarco Jul 26, 2022
bea6cb5
odd github actions negation syntax
nickpdemarco Jul 26, 2022
8f96321
misunderstood github actions expression syntax... clunky "== false" t…
nickpdemarco Jul 26, 2022
c560e8b
missed save of matrix.json which caused confusion
nickpdemarco Jul 26, 2022
e47e234
missed a sudo
nickpdemarco Jul 26, 2022
7ed6666
Use open source action to setup emsdk
nickpdemarco Jul 26, 2022
a1ed4a0
cleverness to get emsdk root for boost install
nickpdemarco Jul 26, 2022
8dd4bdc
simplify boost root path. emscripten sysroot appears unnecessary on l…
nickpdemarco Jul 26, 2022
552866f
consolidate steps and improve reuse. build boost before configuring s…
nickpdemarco Jul 26, 2022
f148360
Put back emsdk sysroot
nickpdemarco Jul 26, 2022
271f872
try replacing ~ with $HOME
nickpdemarco Jul 26, 2022
c7baafe
Fix logic error in StlabUtil.cmake
nickpdemarco Jul 26, 2022
d300ae8
Fix path typo in stlab.yml
nickpdemarco Jul 26, 2022
8155eae
remove stale requirement for matching main executor and task system
nickpdemarco Jul 26, 2022
7f8fa1d
remove unused dockerfile
nickpdemarco Jul 26, 2022
34b45ae
remove unused dockerignore
nickpdemarco Jul 26, 2022
bbcbb82
Add newline to stlab.yml
nickpdemarco Jul 26, 2022
2d7a78d
Remove unnecessary install prefix and boost_root settings.
nickpdemarco Jul 27, 2022
78310a8
remove redundant parens
nickpdemarco Jul 27, 2022
bb1ae72
Use --shallow-submodules and --jobs=8 to speed up boost clone
nickpdemarco Jul 27, 2022
a02dc0e
Move emcc verification step into cmake file, out of github action
nickpdemarco Jul 27, 2022
05b3f4d
Attempt minimal install of emsdk over mymindstorm dependency
nickpdemarco Jul 27, 2022
243a70b
Use bash -l /Users/demarco/emsdk/emsdk_env.sh on steps that require e…
nickpdemarco Jul 27, 2022
c2c35af
Attempt alternative way of installing emsdk to bash profile
nickpdemarco Jul 27, 2022
f481a8f
Yet another attempt at setting up emsdk manually
nickpdemarco Jul 27, 2022
a1aa05c
Explicitly source at each step
nickpdemarco Jul 27, 2022
f0b95c2
Did I really just miss an ?
nickpdemarco Jul 27, 2022
ef13a38
Did I really just miss an activate?
nickpdemarco Jul 27, 2022
e084ac7
Merge branch 'demarco/wasm-ci' of https://github.com/stlab/libraries …
nickpdemarco Jul 27, 2022
28ae72d
Wrap source in quotes
nickpdemarco Jul 27, 2022
d6c00fe
-sPTHREAD_POOL_SIZE to 32 from 100
nickpdemarco Jul 27, 2022
09505e0
Add cmake/ExperimentalEmscripten.cmake, a toolchain for using the min…
nickpdemarco Jul 29, 2022
227025f
Merge branch 'main' into demarco/wasm-ci
nickpdemarco Jul 29, 2022
3460534
missing newline in ExperimentalEmscripten.cmake
nickpdemarco Jul 29, 2022
da996f5
revert trivial changes to test/CMakeLists.txt
nickpdemarco Jul 29, 2022
d83968e
Remove now unnecessary emscripten conditional
nickpdemarco Jul 29, 2022
76fa5fe
stlab.yml cleanup
nickpdemarco Jul 29, 2022
dffd22b
nit in ExperimentalEmscripten.cmake
nickpdemarco Jul 29, 2022
4c9e290
Absolute paths to ExperimentalEmscripten.cmake in stlab.yml
nickpdemarco Jul 29, 2022
3bf3b5c
-Wno-deprecated-builtins for boost to quiet our build output.
nickpdemarco Jul 29, 2022
19c2a18
Checking if BOOST_INCLUDE_LIBRARIES is breaking my include paths
nickpdemarco Jul 29, 2022
40024ad
Fix check for node version. Add --output-on-failure to ctest
nickpdemarco Jul 29, 2022
4f89847
Override Emsdk's bundled node with the system installation, since the…
nickpdemarco Jul 29, 2022
9778f92
Logging for debugging
nickpdemarco Jul 29, 2022
a8351bb
missing quotes
nickpdemarco Jul 29, 2022
9ffc1a9
Putting back comment in emscripten main executor
nickpdemarco Jul 29, 2022
88ebfa1
Add exception handling comment to emscripten main executor
nickpdemarco Jul 29, 2022
27cc788
Make .emscripten overwrite more terse
nickpdemarco Jul 29, 2022
dd8bb92
Use consistent naming for action steps
nickpdemarco Jul 29, 2022
2aa73a3
Attempt a leaner boost library set to reduce compile time
nickpdemarco Jul 29, 2022
a6514f6
Add boost::multiprecision dependency
nickpdemarco Jul 29, 2022
9560cfd
consistency in platform titles in gh actions
nickpdemarco Jul 29, 2022
d8dc072
Apply suggestions from code review
nickpdemarco Aug 1, 2022
6c3fdb7
Remove noop git pull command
nickpdemarco Aug 1, 2022
760fb51
Make cmake formatting consistent in emscripten snippet
nickpdemarco Aug 1, 2022
9a52929
Put back $HOME to see if it fixes CI
nickpdemarco Aug 2, 2022
9cf3d86
Move emcc version printout to the emscripten toolchain file
nickpdemarco Aug 2, 2022
e809c54
Move cmake/ExperimentalEmscripten.cmake to cmake/Platform/Emscripten-…
nickpdemarco Aug 2, 2022
5d8e0da
Make emscripten include work with system installations
nickpdemarco Aug 2, 2022
fd3d55c
Respond to various review comments in Emscripten-STLab.cmake
nickpdemarco Aug 2, 2022
362d148
Attempt to standardize naming of github actions steps
nickpdemarco Aug 2, 2022
cf994bb
Apply suggestions from code review
nickpdemarco Aug 2, 2022
b662df6
Apply suggestions from code review
nickpdemarco Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
"version": "16",
"os": "windows-2019",
"cmake_toolset": "Visual Studio 16 2019"
},
{
"name": "Linux Webassembly",
"compiler": "emscripten",
"os": "ubuntu-22.04"
}
]
}
71 changes: 57 additions & 14 deletions .github/workflows/stlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
id: set-matrix
# Note: The json in this variable must be a single line for parsing to succeed.
run: echo "::set-output name=matrix::$(cat .github/matrix.json | scripts/flatten_json.py)"

builds:
needs: generate-matrix
runs-on: ${{ matrix.config.os }}
Expand All @@ -31,63 +31,106 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install dependencies (macos)
- name: Install dependencies // macOS
if: ${{ startsWith(matrix.config.os, 'macos') }}
run: |
brew update
brew install boost
brew install ninja
shell: bash

- name: Install dependencies (ubuntu)
if: ${{ startsWith(matrix.config.os, 'ubuntu') }}
- name: Install dependencies // Linux (GCC|Clang)
if: ${{ startsWith(matrix.config.os, 'ubuntu') && !startsWith(matrix.config.compiler, 'emscripten') }}
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
sudo apt-get install -y libboost-all-dev
shell: bash

- name: Install dependencies (Windows)
- name: Install dependencies // Windows
if: ${{ startsWith(matrix.config.os, 'windows') }}
run: |
choco install --yes ninja
vcpkg install boost-test:x64-windows boost-multiprecision:x64-windows boost-variant:x64-windows
shell: cmd

- name: Set enviroment variables (Linux+GCC)
- name: Install dependencies // Linux Emscripten
if: ${{ startsWith(matrix.config.compiler, 'emscripten') }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
git clone --depth 1 --recurse-submodules --shallow-submodules --jobs=8 https://github.com/boostorg/boost.git $HOME/boost

git clone --depth 1 https://github.com/emscripten-core/emsdk.git $HOME/emsdk
pushd $HOME/emsdk
./emsdk install latest
./emsdk activate latest
echo 'source "$HOME/emsdk/emsdk_env.sh"' >> $HOME/.bash_profile

# Override Emsdk's bundled node (14.18.2) to the GH Actions system installation (>= 16.16.0)
sed -i "/^NODE_JS = .*/c\NODE_JS = '`which node`'" .emscripten
echo "Overwrote .emscripten config file to:"
cat .emscripten
popd

- name: Set enviroment variables // Linux GCC
if: ${{ matrix.config.compiler == 'gcc' }}
shell: bash
run: |
echo "CC=gcc-${{matrix.config.version}}" >> $GITHUB_ENV
echo "CXX=g++-${{matrix.config.version}}" >> $GITHUB_ENV

- name: Set enviroment variables (Linux+Clang)
- name: Set enviroment variables // Linux Clang
if: ${{ matrix.config.compiler == 'clang' }}
shell: bash
run: |
echo "CC=clang-${{matrix.config.version}}" >> $GITHUB_ENV
echo "CXX=clang++-${{matrix.config.version}}" >> $GITHUB_ENV

- name: Configure (Unix)
if: ${{ startsWith(matrix.config.os, 'ubuntu') || startsWith(matrix.config.os, 'macos') }}
- name: Compile Boost // Emscripten
if: ${{ startsWith(matrix.config.compiler, 'emscripten') }}
shell: bash -l {0}
run: |
mkdir -p ../build-boost
cmake -S $HOME/boost -B ../build-boost -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=23 \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-builtins" \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/Platform/Emscripten-STLab.cmake \
-DBOOST_INCLUDE_LIBRARIES="optional;variant;multiprecision;test"

cmake --build ../build-boost
cmake --install ../build-boost

- name: Configure // Unix !Emscripten
if: ${{ (startsWith(matrix.config.os, 'ubuntu') || startsWith(matrix.config.os, 'macos')) && !startsWith(matrix.config.compiler, 'emscripten') }}
shell: bash
run: |
mkdir ../build
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=23

- name: Configure (Windows)
- name: Configure // Linux Emscripten
if: ${{ startsWith(matrix.config.compiler, 'emscripten') }}
shell: bash -l {0}
run: |
mkdir ../build
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=23 \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/cmake/Platform/Emscripten-STLab.cmake

- name: Configure // Windows
if: ${{ startsWith(matrix.config.os, 'windows') }}
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
mkdir ..\build
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_CXX_STANDARD=23
cmake -S. -B../build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=23 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Build (Unix)
- name: Build // Unix
if: ${{ startsWith(matrix.config.os, 'ubuntu') || startsWith(matrix.config.os, 'macos') }}
shell: bash
run: |
cmake --build ../build/

- name: Build (windows)
- name: Build // Windows
if: ${{ startsWith(matrix.config.os, 'windows') }}
shell: cmd
run: |
Expand All @@ -98,4 +141,4 @@ jobs:
shell: bash
run: |
cd ../build/
ctest
ctest --output-on-failure
nickpdemarco marked this conversation as resolved.
Show resolved Hide resolved
139 changes: 139 additions & 0 deletions cmake/Platform/Emscripten-STLab.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#
# This toolchain file extends `Emscripten.cmake` provided by the Emscripten SDK,
# and set options required to run STLab test drivers with
# CTest (using a node runner).
#

#
# Find the Emscripten SDK and include its CMake toolchain.
#
find_program( EM_CONFIG_EXECUTABLE em-config )
if ( NOT EM_CONFIG_EXECUTABLE )
message( FATAL_ERROR "Could not find emsdk installation. Please install the Emscripten SDK.\nhttps://emscripten.org/docs/getting_started/downloads.html" )
endif()

execute_process( COMMAND ${EM_CONFIG_EXECUTABLE} EMSCRIPTEN_ROOT OUTPUT_VARIABLE EMSDK_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE )
include( ${EMSDK_ROOT}/cmake/Modules/Platform/Emscripten.cmake )

#
# Set compiler and linker flags.
#

#
# `-pthread`
# STLab uses threads. Without these, the tests will not compile.
#
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread" )

#
# `-fwasm-exceptions`:
# STLab uses exceptions. Without these, the tests error out with:
#
# Pthread 0x005141d0 sent an error! http://localhost:6931/<throwing test>: uncaught exception: 10570976 \
# - Exception catching is disabled, this exception cannot be caught.
#
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fwasm-exceptions" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fwasm-exceptions" )

#
# `-sSUPPORT_LONGJMP=wasm`
# Enables experimental support for LONGJMP in functions which may throw exceptions.
# Without this, Boost doesn't compile (LLVM errors out).
#
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sSUPPORT_LONGJMP=wasm" )

#
# `-sEXIT_RUNTIME=1`
# Indicates the runtime environment (node) should exit when `main()` returns.
#
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sEXIT_RUNTIME=1" )

#
# `-sINITIAL_MEMORY=300MB`
# Without this, the tests throw an Out Of Memory error (OOM). The first sign is an error out with the following:
#
# Pthread 0x0058faf8 sent an error! http://localhost:6931/<test>: RuntimeError: unreachable executed
#
# If the problematic test is run in a browser with `emrun`, JavaScript errors are emitted that explain:
#
# Aborted(Cannot enlarge memory arrays to size 17457152 bytes (OOM). Either
# (1) compile with -sINITIAL_MEMORY=X with X higher than the current value 16777216,
# (2) compile with -sALLOW_MEMORY_GROWTH which allows increasing the size at runtime, or
# (3) if you want malloc to return NULL (0) instead of this abort, compile with -sABORTING_MALLOC=0)
#
# Note that (2) is not an option because pthread cannot yet be combined with -sALLOW_MEMORY_GROWTH:
# See https://github.com/WebAssembly/design/issues/1271
# Smaller values (150MB, 200MB) produce intermittent failures. 300MB was chosen to give enough headroom for
# tests written in the future.
#
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sINITIAL_MEMORY=300MB" )

#
# `-sPTHREAD_POOL_SIZE=32`
# Without this, the tests deadlock. Lower values were tested.
# 8 threads deadlocked consistently, 16 threads passed consistently.
# 32 was chosen to give enough headroom for tests written in the future.
#
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sPTHREAD_POOL_SIZE=32" )

#
# `-sPROXY_TO_PTHREAD`
# This flag wraps our executable's main function in a pthread.
# Without this, we exhaust the thread pool very quickly. The error looks like this:
#
# Tried to spawn a new thread, but the thread pool is exhausted.
# This might result in a deadlock unless some threads eventually exit or the code explicitly breaks out to the event loop.
#
# You can read more about the setting here: https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread
#
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sPROXY_TO_PTHREAD" )

#
# Set the minimum required version for node; earlier versions lack sufficient exception support.
# Note: https://www.npmjs.com/package/wasm-check is a useful utility to find which
# --experimental-wasm-xxx flags are supported by node.
#
set( STLAB_WASM_NODE_JS_MIN_VERSION "16.16.0" )

set( NODE_JS_FLAGS "--experimental-wasm-threads;--experimental-wasm-eh" )
nickpdemarco marked this conversation as resolved.
Show resolved Hide resolved

#
# Check if NODE_JS_EXECUTABLE (found by find_program() in Emscripten.cmake) is recent enough for STLab.
# Set CMAKE_CROSSCOMPILING_EMULATOR to a sufficiently recent node + required experimental flags.
#
if ( NOT NODE_JS_EXECUTABLE )
message( FATAL_ERROR "stlab:wasm: Unable to find node. Please install ${STLAB_WASM_NODE_JS_MIN_VERSION} or newer." )
endif()

message( STATUS "stlab:wasm: Ensuring ${NODE_JS_EXECUTABLE} is at least ${STLAB_WASM_NODE_JS_MIN_VERSION}..." )
execute_process( COMMAND ${NODE_JS_EXECUTABLE} --version OUTPUT_VARIABLE NODE_JS_EXECUTABLE_V_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
STRING( REPLACE "v" "" NODE_JS_EXECUTABLE_VERSION ${NODE_JS_EXECUTABLE_V_VERSION} )

if ( NODE_JS_EXECUTABLE_VERSION VERSION_LESS ${STLAB_WASM_NODE_JS_MIN_VERSION} )
message( FATAL_ERROR "stlab:wasm: Unsupported node: ${NODE_JS_EXECUTABLE_VERSION}. Please install ${STLAB_WASM_NODE_JS_MIN_VERSION} or newer." )
endif()

message( STATUS "stlab:wasm: Installed node satisfies requirements: ${NODE_JS_EXECUTABLE_VERSION}" )
set( CMAKE_CROSSCOMPILING_EMULATOR "${NODE_JS_EXECUTABLE};${NODE_JS_FLAGS}" )

#
# Emscripten supports dynamic linking, but doing so introduces some complexity:
# https://emscripten.org/docs/compiling/Dynamic-Linking.html
# We presently have no need to dynamically link WASM modules, so we instruct
# boost to link statically.
#
# It would be nice if Boost respected (BUILD_SHARED_LIBS OFF), but it does not.
#
set( BUILD_SHARED_LIBS OFF )
set( Boost_USE_STATIC_LIBS ON )

#
# Print the emcc version information, if relevant.
#
execute_process( COMMAND emcc -v ERROR_VARIABLE EMCC_VERSION )
STRING( REGEX REPLACE "\n" ";" EMCC_VERSION "${EMCC_VERSION}" )
message ( STATUS "stlab: Emscripten version:" )
foreach( LINE ${EMCC_VERSION} )
message ( STATUS "\t${LINE}" )
endforeach()
41 changes: 40 additions & 1 deletion stlab/concurrency/main_executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,46 @@ struct main_executor_type {

#elif STLAB_MAIN_EXECUTOR(EMSCRIPTEN)

using main_executor_type = default_executor_type;
struct main_scheduler_type {
camio marked this conversation as resolved.
Show resolved Hide resolved
using result_type = void;

template <class F>
void operator()(F&& f) const {
using function_type = typename std::remove_reference<F>::type;
auto p = new function_type(std::forward<F>(f));

/*
`emscripten_async_run_in_main_runtime_thread()` schedules a function to run on the main
JS thread, however, the code can be executed at any POSIX thread cancelation point if
wasm code is executing on the JS main thread.
Executing the code from a POSIX thread cancelation point can cause problems, including
deadlocks and data corruption. Consider:
```
mutex.lock(); // <-- If reentered, would deadlock here
new T; // <-- POSIX cancelation point, could reenter
```
The call to `emscripten_async_call()` bounces the call to execute as part of the main
run-loop on the current (main) thread. This avoids nasty reentrancy issues if executed
from a POSIX thread cancelation point.
*/

emscripten_async_run_in_main_runtime_thread(
nickpdemarco marked this conversation as resolved.
Show resolved Hide resolved
EM_FUNC_SIG_VI,
camio marked this conversation as resolved.
Show resolved Hide resolved
static_cast<void(*)(void*)>([](void* f_) {
camio marked this conversation as resolved.
Show resolved Hide resolved
emscripten_async_call(
camio marked this conversation as resolved.
Show resolved Hide resolved
[](void* f_) {
auto f = static_cast<function_type*>(f_);
// Note the absence of exception handling.
// Operations queued to the task system cannot throw as a precondition.
// We use packaged tasks to marshal exceptions.
(*f)();
nickpdemarco marked this conversation as resolved.
Show resolved Hide resolved
delete f;
},
f_, 0);
}),
p);
}
};

#elif STLAB_MAIN_EXECUTOR(NONE)

Expand Down