Explorar el Código

Fix pthread_getspecific return value (#999)

Fix pthread_getspecific return value as mentioned in #995
Xu Jun hace 3 años
padre
commit
5f8c7655a7
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      core/iwasm/libraries/lib-pthread/lib_pthread_wrapper.c

+ 2 - 2
core/iwasm/libraries/lib-pthread/lib_pthread_wrapper.c

@@ -1011,7 +1011,7 @@ pthread_setspecific_wrapper(wasm_exec_env_t exec_env, int32 key,
     key_values = key_value_list_lookup_or_create(exec_env, info, key);
     if (!key_values) {
         os_mutex_unlock(&info->key_data_list_lock);
-        return 0;
+        return -1;
     }
 
     key_values[key] = value_offset;
@@ -1028,7 +1028,7 @@ pthread_getspecific_wrapper(wasm_exec_env_t exec_env, int32 key)
     int32 ret, *key_values;
 
     if (!info)
-        return -1;
+        return 0;
 
     os_mutex_lock(&info->key_data_list_lock);