wasm_shared_memory.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _WASM_SHARED_MEMORY_H
  6. #define _WASM_SHARED_MEMORY_H
  7. #include "bh_common.h"
  8. #include "../interpreter/wasm_runtime.h"
  9. #include "wasm_runtime_common.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. bool
  14. wasm_shared_memory_init();
  15. void
  16. wasm_shared_memory_destroy();
  17. uint32
  18. shared_memory_inc_reference(WASMMemoryInstance *memory);
  19. uint32
  20. shared_memory_dec_reference(WASMMemoryInstance *memory);
  21. bool
  22. shared_memory_is_shared(WASMMemoryInstance *memory);
  23. void
  24. shared_memory_lock(WASMMemoryInstance *memory);
  25. void
  26. shared_memory_unlock(WASMMemoryInstance *memory);
  27. uint32
  28. wasm_runtime_atomic_wait(WASMModuleInstanceCommon *module, void *address,
  29. uint64 expect, int64 timeout, bool wait64);
  30. uint32
  31. wasm_runtime_atomic_notify(WASMModuleInstanceCommon *module, void *address,
  32. uint32 count);
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif /* end of _WASM_SHARED_MEMORY_H */