Thread safe
This commit is contained in:
14
sqlite3.go
14
sqlite3.go
@@ -6,13 +6,17 @@
|
|||||||
package sqlite3
|
package sqlite3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifdef _WIN32
|
|
||||||
# define _localtime32(x) localtime(x)
|
|
||||||
#endif
|
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <time.h>
|
||||||
|
struct tm* _localtime32(const __time32_t *tm) {
|
||||||
|
return localtime(tm);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
# include <errno.h>
|
# include <errno.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -25,6 +29,10 @@ package sqlite3
|
|||||||
# define SQLITE_OPEN_FULLMUTEX 0
|
# define SQLITE_OPEN_FULLMUTEX 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SQLITE_THREADSAFE
|
||||||
|
# define SQLITE_THREADSAFE
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
|
_sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
|
||||||
#ifdef SQLITE_OPEN_URI
|
#ifdef SQLITE_OPEN_URI
|
||||||
|
|||||||
Reference in New Issue
Block a user