emnapi 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +23 -2
- package/README.md +213 -94
- package/dist/library_napi.js +258 -33
- package/include/emnapi.h +1 -1
- package/include/js_native_api.h +1 -1
- package/index.js +6 -0
- package/lib/wasm32/libemnapi-basic.a +0 -0
- package/lib/wasm32/libemnapi.a +0 -0
- package/lib/wasm32-emscripten/libemnapi-basic.a +0 -0
- package/lib/wasm32-emscripten/libemnapi-mt.a +0 -0
- package/lib/wasm32-emscripten/libemnapi.a +0 -0
- package/lib/wasm32-emscripten.txt +2 -2
- package/lib/wasm32-wasi/libemnapi-basic.a +0 -0
- package/lib/wasm32-wasi/libemnapi.a +0 -0
- package/package.json +1 -1
- package/src/async_cleanup_hook.c +126 -0
- package/src/async_context.c +53 -0
- package/src/async_work.c +236 -0
- package/src/emnapi.c +1 -1324
- package/src/emnapi_internal.h +171 -0
- package/src/js_native_api.c +106 -0
- package/src/node_api.c +73 -0
- package/src/threadsafe_function.c +617 -0
- package/src/uv/threadpool.c +36 -5
- package/src/uv/unix/async.c +1 -1
- package/src/uv/unix/thread.c +10 -1
- /package/include/{common.h → emnapi_common.h} +0 -0
package/src/uv/unix/async.c
CHANGED
package/src/uv/unix/thread.c
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
#include <time.h>
|
|
7
7
|
#include "uv.h"
|
|
8
8
|
|
|
9
|
+
// #define CHECK_RET(the_call) \
|
|
10
|
+
// do { \
|
|
11
|
+
// int r = (the_call); \
|
|
12
|
+
// if (r) { \
|
|
13
|
+
// fprintf(stderr, #the_call ": %d\n", r); \
|
|
14
|
+
// abort(); \
|
|
15
|
+
// } \
|
|
16
|
+
// } while (0)
|
|
17
|
+
|
|
9
18
|
void uv_sem_post(sem_t* sem) {
|
|
10
19
|
if (sem_post(sem))
|
|
11
20
|
abort();
|
|
@@ -39,7 +48,7 @@ void uv_once(pthread_once_t* guard, void (*callback)(void)) {
|
|
|
39
48
|
}
|
|
40
49
|
|
|
41
50
|
int uv_mutex_init(uv_mutex_t* mutex) {
|
|
42
|
-
#if defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
|
|
51
|
+
#if defined(__wasi__) || defined(NDEBUG) || !defined(PTHREAD_MUTEX_ERRORCHECK)
|
|
43
52
|
return pthread_mutex_init(mutex, NULL);
|
|
44
53
|
#else
|
|
45
54
|
pthread_mutexattr_t attr;
|
|
File without changes
|