Enable shared memory && add pthread support (#282)
This commit is contained in:
@ -28,6 +28,17 @@ get_base_lib_export_apis(NativeSymbol **p_base_lib_apis);
|
||||
uint32
|
||||
get_ext_lib_export_apis(NativeSymbol **p_ext_lib_apis);
|
||||
|
||||
#if WASM_ENABLE_LIB_PTHREAD != 0
|
||||
bool
|
||||
lib_pthread_init();
|
||||
|
||||
void
|
||||
lib_pthread_destroy();
|
||||
|
||||
uint32
|
||||
get_lib_pthread_export_apis(NativeSymbol **p_lib_pthread_apis);
|
||||
#endif
|
||||
|
||||
static bool
|
||||
check_symbol_signature(const WASMType *type, const char *signature)
|
||||
{
|
||||
@ -278,6 +289,17 @@ wasm_native_init()
|
||||
return false;
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_LIB_PTHREAD != 0
|
||||
if (!lib_pthread_init())
|
||||
return false;
|
||||
|
||||
n_native_symbols = get_lib_pthread_export_apis(&native_symbols);
|
||||
if (n_native_symbols > 0
|
||||
&& !wasm_native_register_natives("env",
|
||||
native_symbols, n_native_symbols))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -286,6 +308,10 @@ wasm_native_destroy()
|
||||
{
|
||||
NativeSymbolsNode *node, *node_next;
|
||||
|
||||
#if WASM_ENABLE_LIB_PTHREAD != 0
|
||||
lib_pthread_destroy();
|
||||
#endif
|
||||
|
||||
node = g_native_symbols_list;
|
||||
while (node) {
|
||||
node_next = node->next;
|
||||
|
||||
Reference in New Issue
Block a user