Sfoglia il codice sorgente

Fix issue in multi-thread sample (#1458)

Set `WAMR_BUILD_LIB_PTHREAD_SEMAPHORE` for the sample,
and update document.
Xu Jun 3 anni fa
parent
commit
5722fcc40a
3 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 1 1
      core/shared/utils/bh_list.h
  2. 4 0
      doc/build_wamr.md
  3. 1 0
      samples/multi-thread/CMakeLists.txt

+ 1 - 1
core/shared/utils/bh_list.h

@@ -59,7 +59,7 @@ bh_list_init(bh_list *list);
  *                <code>BH_LIST_ERROR</code> if input is invalid or no memory
  * available.
  */
-extern bh_list_status
+bh_list_status
 bh_list_insert(bh_list *list, void *elem);
 
 /**

+ 4 - 0
doc/build_wamr.md

@@ -77,6 +77,10 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
 - **WAMR_BUILD_LIB_PTHREAD**=1/0, default to disable if not set
 > Note: The dependent feature of lib pthread such as the `shared memory` and `thread manager` will be enabled automatically.
 
+#### **Enable lib-pthread-semaphore**
+- **WAMR_BUILD_LIB_PTHREAD_SEMAPHORE**=1/0, default to disable if not set
+> Note: This feature depends on `lib-pthread`, it will be enabled automatically if this feature is enabled.
+
 #### **Disable boundary check with hardware trap in AOT or JIT mode**
 - **WAMR_DISABLE_HW_BOUND_CHECK**=1/0, default to enable if not set and supported by platform
 > Note: by default only platform linux/darwin/android/vxworks 64-bit will enable boundary check with hardware trap in AOT or JIT mode, and the wamrc tool will generate AOT code without boundary check instructions in all 64-bit targets except SGX to improve performance.

+ 1 - 0
samples/multi-thread/CMakeLists.txt

@@ -45,6 +45,7 @@ set(WAMR_BUILD_JIT 0)
 set(WAMR_BUILD_LIBC_BUILTIN 1)
 set(WAMR_BUILD_FAST_INTERP 1)
 set(WAMR_BUILD_LIB_PTHREAD 1)
+set(WAMR_BUILD_LIB_PTHREAD_SEMAPHORE 1)
 
 # compiling and linking flags
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie -fPIE")