Re-org thread env init/destroy for HW bound check (#631)

And fix cmake_minimum_required() deprecation warning since envoy is using cmake 3.16 or higher version.
This commit is contained in:
Wenyong Huang
2021-05-14 11:13:12 +08:00
committed by GitHub
parent 17a2167485
commit a14a4487bb
16 changed files with 205 additions and 126 deletions

View File

@ -392,6 +392,27 @@ wasm_runtime_create_exec_env(wasm_module_inst_t module_inst,
WASM_RUNTIME_API_EXTERN void
wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
/**
* Initialize thread environment.
* Note:
* If developer creates a child thread by himself to call the
* the wasm function in that thread, he should call this API
* firstly before calling the wasm function and then call
* wasm_runtime_destroy_thread_env() after calling the wasm
* function. If the thread is created from the runtime API,
* it is unnecessary to call these two APIs.
*
* @return true if success, false otherwise
*/
WASM_RUNTIME_API_EXTERN bool
wasm_runtime_init_thread_env();
/**
* Destroy thread environment
*/
WASM_RUNTIME_API_EXTERN void
wasm_runtime_destroy_thread_env();
/**
* Get WASM module instance from execution environment
*