Files
SnowLuma/.pnpm-store/v11/files/ac/f08bc677908834f2e647aab4bd844cbb287d112c9d138a794953c72c0429e4441e45271616cd4e75ce45bd571c5c4f1e20bd987ad873756c0eb4a1119f7c64
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

27 lines
953 B
Plaintext

#ifndef NODE_SQLITE3_SRC_THREADING_H
#define NODE_SQLITE3_SRC_THREADING_H
#include <stdio.h>
#include <stdlib.h>
#include <uv.h>
#define NODE_SQLITE3_MUTEX_t uv_mutex_t mutex;
// A silently uninitialised mutex is worse than a crash: every later
// lock/unlock would be undefined behaviour. uv_mutex_init only fails on
// resource exhaustion, which is not survivable here anyway. The trailing
// semicolon is part of the macro: existing call sites omit their own.
#define NODE_SQLITE3_MUTEX_INIT do { \
int mutex_init_rc_ = uv_mutex_init(&mutex); \
if (mutex_init_rc_ != 0) { \
fprintf(stderr, "node-sqlite3: uv_mutex_init failed: %s\n", \
uv_strerror(mutex_init_rc_)); \
abort(); \
} \
} while (0);
#define NODE_SQLITE3_MUTEX_LOCK(m) uv_mutex_lock(m);
#define NODE_SQLITE3_MUTEX_UNLOCK(m) uv_mutex_unlock(m);
#define NODE_SQLITE3_MUTEX_DESTROY uv_mutex_destroy(&mutex);
#endif // NODE_SQLITE3_SRC_THREADING_H