diff -pur /tmp/orig/DBD-SQLite-1.62/Makefile.PL /tmp/multi/DBD-SQLite-1.62/Makefile.PL
--- orig/DBD-SQLite-1.62/Makefile.PL	2018-12-19 14:30:07.000000000 +0100
+++ multi/DBD-SQLite-1.62/Makefile.PL	2019-03-20 07:31:33.404268974 +0100
@@ -261,9 +261,9 @@ if ( $^O eq 'cygwin') {
 if ( $Config{d_usleep} || $Config{osname} =~ m/linux/ ) {
 	push @CC_DEFINE, '-DHAVE_USLEEP=1';
 }
-unless ( $Config{usethreads} ) {
-	push @CC_DEFINE, '-DTHREADSAFE=0';
-}
+#unless ( $Config{usethreads} ) {
+#	push @CC_DEFINE, '-DTHREADSAFE=0';
+#}
 if ($^O eq 'hpux' and $Config{osvers} <= 10.20) {
 	# HP-UX 10.20 does not have pread () at all
 	push @CC_DEFINE,
@@ -309,6 +309,10 @@ if ($^O eq 'solaris' && $Config{gccversi
 	push @CCFLAGS, "-std=gnu99";
 }
 
+push @CCFLAGS, "-pthread";
+push @CC_LIBS, "-lpthread";
+push @CC_DEFINE, '-DTHREADSAFE=2';
+
 my %CC_OPTIONS = (
 	INC          => join( ' ', @CC_INC    ),
 	DEFINE       => join( ' ', @CC_DEFINE ),
diff -pur /tmp/orig/DBD-SQLite-1.62/SQLite.xs /tmp/multi/DBD-SQLite-1.62/SQLite.xs
--- orig/DBD-SQLite-1.62/SQLite.xs	2018-12-21 20:26:37.000000000 +0100
+++ multi/DBD-SQLite-1.62/SQLite.xs	2019-03-03 14:14:12.648865571 +0100
@@ -2,6 +2,8 @@
 
 #include "SQLiteXS.h"
 
+#include "perlmulticore.h"
+
 DBISTATE_DECLARE;
 
 MODULE = DBD::SQLite          PACKAGE = DBD::SQLite::db
@@ -9,6 +11,7 @@ MODULE = DBD::SQLite          PACKAGE =
 PROTOTYPES: DISABLE
 
 BOOT:
+    perlmulticore_support();
     init_cxt();
     sv_setpv(get_sv("DBD::SQLite::sqlite_version",        TRUE|GV_ADDMULTI), SQLITE_VERSION);
     sv_setiv(get_sv("DBD::SQLite::sqlite_version_number", TRUE|GV_ADDMULTI), SQLITE_VERSION_NUMBER);
diff -pur /tmp/orig/DBD-SQLite-1.62/dbdimp.c /tmp/multi/DBD-SQLite-1.62/dbdimp.c
--- orig/DBD-SQLite-1.62/dbdimp.c	2018-12-22 17:47:18.000000000 +0100
+++ multi/DBD-SQLite-1.62/dbdimp.c	2019-03-20 07:47:17.679096014 +0100
@@ -5,6 +5,8 @@
 
 #include "SQLiteXS.h"
 
+#include "perlmulticore.h"
+
 START_MY_CXT;
 
 DBISTATE_DECLARE;
@@ -167,7 +169,9 @@ _sqlite_exec(pTHX_ SV *h, sqlite3 *db, c
     int rc;
     char *errmsg;
 
+    perlinterp_release ();
     rc = sqlite3_exec(db, sql, NULL, NULL, &errmsg);
+    perlinterp_acquire ();
     if ( rc != SQLITE_OK ) {
         sqlite_error(h, rc, errmsg);
         if (errmsg) sqlite3_free(errmsg);
@@ -179,11 +183,13 @@ int
 _sqlite_open(pTHX_ SV *dbh, const char *dbname, sqlite3 **db, int flags, int extended)
 {
     int rc;
+    perlinterp_release ();
     if (flags) {
         rc = sqlite3_open_v2(dbname, db, flags, NULL);
     } else {
         rc = sqlite3_open(dbname, db);
     }
+    perlinterp_acquire ();
     if ( rc != SQLITE_OK ) {
 #if SQLITE_VERSION_NUMBER >= 3006005
         if (extended)
@@ -1657,6 +1663,7 @@ sqlite_db_busy_timeout(pTHX_ SV *dbh, SV
 static void
 sqlite_db_func_dispatcher(int is_unicode, sqlite3_context *context, int argc, sqlite3_value **value)
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int count;
@@ -1698,6 +1705,7 @@ sqlite_db_func_dispatcher(int is_unicode
     PUTBACK;
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 static void
@@ -1840,6 +1848,7 @@ sqlite_db_table_column_metadata(pTHX_ SV
 static void
 sqlite_db_aggr_new_dispatcher(pTHX_ sqlite3_context *context, aggrInfo *aggr_info)
 {
+    perlinterp_acquire ();
     dSP;
     SV *pkg = NULL;
     int count = 0;
@@ -1848,8 +1857,10 @@ sqlite_db_aggr_new_dispatcher(pTHX_ sqli
     aggr_info->aggr_inst = NULL;
 
     pkg = sqlite3_user_data(context);
-    if ( !pkg )
+    if ( !pkg ) {
+        perlinterp_release ();
         return;
+    }
 
     ENTER;
     SAVETMPS;
@@ -1890,21 +1901,24 @@ sqlite_db_aggr_new_dispatcher(pTHX_ sqli
     FREETMPS;
     LEAVE;
 
-    return;
+    perlinterp_release ();
 }
 
 static void
 sqlite_db_aggr_step_dispatcher(sqlite3_context *context,
                                int argc, sqlite3_value **value)
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int i, is_unicode = 0;  /* TODO : find out from db handle */
     aggrInfo *aggr;
 
     aggr = sqlite3_aggregate_context(context, sizeof (aggrInfo));
-    if ( !aggr )
+    if ( !aggr ) {
+        perlinterp_release ();
         return;
+    }
 
     ENTER;
     SAVETMPS;
@@ -1937,11 +1951,13 @@ sqlite_db_aggr_step_dispatcher(sqlite3_c
  cleanup:
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 static void
 sqlite_db_aggr_finalize_dispatcher( sqlite3_context *context )
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     aggrInfo *aggr, myAggr;
@@ -2003,6 +2019,7 @@ sqlite_db_aggr_finalize_dispatcher( sqli
 
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 int
@@ -2041,6 +2058,7 @@ int
 sqlite_db_collation_dispatcher(void *func, int len1, const void *string1,
                                            int len2, const void *string2)
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int cmp = 0;
@@ -2064,6 +2082,7 @@ sqlite_db_collation_dispatcher(void *fun
     FREETMPS;
     LEAVE;
 
+    perlinterp_release ();
     return cmp;
 }
 
@@ -2071,6 +2090,7 @@ int
 sqlite_db_collation_dispatcher_utf8(void *func, int len1, const void *string1,
                                                 int len2, const void *string2)
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int cmp = 0;
@@ -2099,6 +2119,7 @@ sqlite_db_collation_dispatcher_utf8(void
     FREETMPS;
     LEAVE;
 
+    perlinterp_release ();
     return cmp;
 }
 
@@ -2156,6 +2177,7 @@ sqlite_db_collation_needed_dispatcher(
     const char* collation_name
 )
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
 
@@ -2174,6 +2196,7 @@ sqlite_db_collation_needed_dispatcher(
     PUTBACK;
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 void
@@ -2200,6 +2223,7 @@ sqlite_db_collation_needed(pTHX_ SV *dbh
 int
 sqlite_db_generic_callback_dispatcher( void *callback )
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int n_retval, i;
@@ -2220,6 +2244,7 @@ sqlite_db_generic_callback_dispatcher( v
     FREETMPS;
     LEAVE;
 
+    perlinterp_release ();
     return retval;
 }
 
@@ -2323,6 +2348,7 @@ sqlite_db_update_dispatcher( void *callb
                              char const *database, char const *table,
                              sqlite3_int64 rowid )
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
 
@@ -2342,6 +2368,7 @@ sqlite_db_update_dispatcher( void *callb
     PUTBACK;
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 SV*
@@ -2386,6 +2413,7 @@ sqlite_db_authorizer_dispatcher (
     const char *details_4
 )
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int retval = 0;
@@ -2417,6 +2445,7 @@ sqlite_db_authorizer_dispatcher (
     FREETMPS;
     LEAVE;
 
+    perlinterp_release ();
     return retval;
 }
 
@@ -2456,6 +2485,7 @@ sqlite_db_set_authorizer(pTHX_ SV *dbh,
 void
 sqlite_db_trace_dispatcher(void *callback, const char *sql)
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int n_retval, i;
@@ -2478,6 +2508,7 @@ sqlite_db_trace_dispatcher(void *callbac
     PUTBACK;
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 int
@@ -2514,6 +2545,7 @@ sqlite_db_trace(pTHX_ SV *dbh, SV *func)
 void
 sqlite_db_profile_dispatcher(void *callback, const char *sql, sqlite3_uint64 elapsed)
 {
+    perlinterp_acquire ();
     dTHX;
     dSP;
     int n_retval, i;
@@ -2544,6 +2576,7 @@ sqlite_db_profile_dispatcher(void *callb
     PUTBACK;
     FREETMPS;
     LEAVE;
+    perlinterp_release ();
 }
 
 int
