]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Mark _all_ JNI binding funcs as synchronized so that Java can lock them and protect...
authorstephan <stephan@noemail.net>
Thu, 10 Aug 2023 21:50:52 +0000 (21:50 +0000)
committerstephan <stephan@noemail.net>
Thu, 10 Aug 2023 21:50:52 +0000 (21:50 +0000)
FossilOrigin-Name: afe190a940441de9bef8835c2dc6d278f861a772c3b7c7a2d399b2eabd4872e3

ext/jni/src/org/sqlite/jni/Fts5ExtensionApi.java
ext/jni/src/org/sqlite/jni/SQLite3Jni.java
ext/jni/src/org/sqlite/jni/fts5_api.java
manifest
manifest.uuid

index 758ea717f090c8bdacad531f1bd086ef1b2263e0..ac041e3001c49961b78bda2e3f6cec073c8774d7 100644 (file)
@@ -35,52 +35,52 @@ public final class Fts5ExtensionApi extends NativePointerHolder<Fts5ExtensionApi
   */
   public static synchronized native Fts5ExtensionApi getInstance();
 
-  public native int xColumnCount(@NotNull Fts5Context fcx);
-  public native int xColumnSize(@NotNull Fts5Context cx, int iCol,
+  public synchronized native int xColumnCount(@NotNull Fts5Context fcx);
+  public synchronized native int xColumnSize(@NotNull Fts5Context cx, int iCol,
                                 @NotNull OutputPointer.Int32 pnToken);
-  public native int xColumnText(@NotNull Fts5Context cx, int iCol,
+  public synchronized native int xColumnText(@NotNull Fts5Context cx, int iCol,
                                 @NotNull OutputPointer.String txt);
-  public native int xColumnTotalSize(@NotNull Fts5Context fcx, int iCol,
+  public synchronized native int xColumnTotalSize(@NotNull Fts5Context fcx, int iCol,
                                      @NotNull OutputPointer.Int64 pnToken);
-  public native Object xGetAuxdata(@NotNull Fts5Context cx, boolean clearIt);
-  public native int xInst(@NotNull Fts5Context cx, int iIdx,
+  public synchronized native Object xGetAuxdata(@NotNull Fts5Context cx, boolean clearIt);
+  public synchronized native int xInst(@NotNull Fts5Context cx, int iIdx,
                           @NotNull OutputPointer.Int32 piPhrase,
                           @NotNull OutputPointer.Int32 piCol,
                           @NotNull OutputPointer.Int32 piOff);
-  public native int xInstCount(@NotNull Fts5Context fcx,
+  public synchronized native int xInstCount(@NotNull Fts5Context fcx,
                                @NotNull OutputPointer.Int32 pnInst);
-  public native int xPhraseCount(@NotNull Fts5Context fcx);
-  public native int xPhraseFirst(@NotNull Fts5Context cx, int iPhrase,
+  public synchronized native int xPhraseCount(@NotNull Fts5Context fcx);
+  public synchronized native int xPhraseFirst(@NotNull Fts5Context cx, int iPhrase,
                                  @NotNull Fts5PhraseIter iter,
                                  @NotNull OutputPointer.Int32 iCol,
                                  @NotNull OutputPointer.Int32 iOff);
-  public native int xPhraseFirstColumn(@NotNull Fts5Context cx, int iPhrase,
+  public synchronized native int xPhraseFirstColumn(@NotNull Fts5Context cx, int iPhrase,
                                        @NotNull Fts5PhraseIter iter,
                                        @NotNull OutputPointer.Int32 iCol);
-  public native void xPhraseNext(@NotNull Fts5Context cx,
+  public synchronized native void xPhraseNext(@NotNull Fts5Context cx,
                                  @NotNull Fts5PhraseIter iter,
                                  @NotNull OutputPointer.Int32 iCol,
                                  @NotNull OutputPointer.Int32 iOff);
-  public native void xPhraseNextColumn(@NotNull Fts5Context cx,
+  public synchronized native void xPhraseNextColumn(@NotNull Fts5Context cx,
                                        @NotNull Fts5PhraseIter iter,
                                        @NotNull OutputPointer.Int32 iCol);
-  public native int xPhraseSize(@NotNull Fts5Context fcx, int iPhrase);
-  public native int xQueryPhrase(@NotNull Fts5Context cx, int iPhrase,
+  public synchronized native int xPhraseSize(@NotNull Fts5Context fcx, int iPhrase);
+  public synchronized native int xQueryPhrase(@NotNull Fts5Context cx, int iPhrase,
                                  @NotNull xQueryPhraseCallback callback);
-  public native int xRowCount(@NotNull Fts5Context fcx,
+  public synchronized native int xRowCount(@NotNull Fts5Context fcx,
                               @NotNull OutputPointer.Int64 nRow);
-  public native long xRowid(@NotNull Fts5Context cx);
+  public synchronized native long xRowid(@NotNull Fts5Context cx);
   /* Note that the JNI binding lacks the C version's xDelete()
      callback argument. Instead, if pAux has an xDestroy() method, it
      is called if the FTS5 API finalizes the aux state (including if
      allocation of storage for the auxdata fails). Any reference to
      pAux held by the JNI layer will be relinquished regardless of
      whether pAux has an xDestroy() method. */
-  public native int xSetAuxdata(@NotNull Fts5Context cx, @Nullable Object pAux);
-  public native int xTokenize(@NotNull Fts5Context cx, @NotNull byte pText[],
+  public synchronized native int xSetAuxdata(@NotNull Fts5Context cx, @Nullable Object pAux);
+  public synchronized native int xTokenize(@NotNull Fts5Context cx, @NotNull byte pText[],
                               @NotNull Fts5.xTokenizeCallback callback);
 
-  public native Object xUserData(Fts5Context cx);
+  public synchronized native Object xUserData(Fts5Context cx);
   //^^^ returns the pointer passed as the 3rd arg to the C-level
   // fts5_api::xCreateFunction.
 }
index 451b328790f196db0f32806bbca8f1c289ed88e5..b6f07927ccb2e8ee25b02f6ad6a78483dbcc2057 100644 (file)
@@ -203,27 +203,27 @@ public final class SQLite3Jni {
       : sqlite3_bind_blob(stmt, ndx, data, data.length);
   }
 
-  private static native int sqlite3_bind_blob(
+  private static synchronized native int sqlite3_bind_blob(
     @NotNull sqlite3_stmt stmt, int ndx, @Nullable byte[] data, int n
   );
 
-  public static native int sqlite3_bind_double(
+  public static synchronized native int sqlite3_bind_double(
     @NotNull sqlite3_stmt stmt, int ndx, double v
   );
 
-  public static native int sqlite3_bind_int(
+  public static synchronized native int sqlite3_bind_int(
     @NotNull sqlite3_stmt stmt, int ndx, int v
   );
 
-  public static native int sqlite3_bind_int64(
+  public static synchronized native int sqlite3_bind_int64(
     @NotNull sqlite3_stmt stmt, int ndx, long v
   );
 
-  public static native int sqlite3_bind_null(
+  public static synchronized native int sqlite3_bind_null(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native int sqlite3_bind_parameter_count(
+  public static synchronized native int sqlite3_bind_parameter_count(
     @NotNull sqlite3_stmt stmt
   );
 
@@ -231,7 +231,7 @@ public final class SQLite3Jni {
   /** A level of indirection required to ensure that the input to the
       C-level function of the same name is a NUL-terminated UTF-8
       string. */
-  private static native int sqlite3_bind_parameter_index(
+  private static synchronized native int sqlite3_bind_parameter_index(
     @NotNull sqlite3_stmt stmt, byte[] paramName
   );
 
@@ -263,15 +263,15 @@ public final class SQLite3Jni {
      SQLITE_TRANSIENT for the final parameter and (B) behaves like
      sqlite3_bind_null() if the data argument is null.
   */
-  private static native int sqlite3_bind_text(
+  private static synchronized native int sqlite3_bind_text(
     @NotNull sqlite3_stmt stmt, int ndx, @Nullable byte[] data, int maxBytes
   );
 
-  public static native int sqlite3_bind_zeroblob(
+  public static synchronized native int sqlite3_bind_zeroblob(
     @NotNull sqlite3_stmt stmt, int ndx, int n
   );
 
-  public static native int sqlite3_bind_zeroblob64(
+  public static synchronized native int sqlite3_bind_zeroblob64(
     @NotNull sqlite3_stmt stmt, int ndx, long n
   );
 
@@ -281,11 +281,11 @@ public final class SQLite3Jni {
      to clear the busy handler. Calling this multiple times with the
      same object is a no-op on the second and subsequent calls.
   */
-  public static native synchronized int sqlite3_busy_handler(
+  public static synchronized native int sqlite3_busy_handler(
     @NotNull sqlite3 db, @Nullable BusyHandler handler
   );
 
-  public static native synchronized int sqlite3_busy_timeout(
+  public static synchronized native int sqlite3_busy_timeout(
     @NotNull sqlite3 db, int ms
   );
 
@@ -297,59 +297,59 @@ public final class SQLite3Jni {
     @NotNull AutoExtension ax
   );
 
-  public static native int sqlite3_changes(
+  public static synchronized native int sqlite3_changes(
     @NotNull sqlite3 db
   );
 
-  public static native long sqlite3_changes64(
+  public static synchronized native long sqlite3_changes64(
     @NotNull sqlite3 db
   );
 
-  public static native int sqlite3_clear_bindings(
+  public static synchronized native int sqlite3_clear_bindings(
     @NotNull sqlite3_stmt stmt
   );
 
-  public static native int sqlite3_close(
+  public static synchronized native int sqlite3_close(
     @NotNull sqlite3 db
   );
 
-  public static native int sqlite3_close_v2(
+  public static synchronized native int sqlite3_close_v2(
     @NotNull sqlite3 db
   );
 
-  public static native byte[] sqlite3_column_blob(
+  public static synchronized native byte[] sqlite3_column_blob(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native int sqlite3_column_bytes(
+  public static synchronized native int sqlite3_column_bytes(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native int sqlite3_column_bytes16(
+  public static synchronized native int sqlite3_column_bytes16(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native int sqlite3_column_count(
+  public static synchronized native int sqlite3_column_count(
     @NotNull sqlite3_stmt stmt
   );
 
-  public static native double sqlite3_column_double(
+  public static synchronized native double sqlite3_column_double(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native int sqlite3_column_int(
+  public static synchronized native int sqlite3_column_int(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native long sqlite3_column_int64(
+  public static synchronized native long sqlite3_column_int64(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native String sqlite3_column_name(
+  public static synchronized native String sqlite3_column_name(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native String sqlite3_column_database_name(
+  public static synchronized native String sqlite3_column_database_name(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
@@ -382,11 +382,11 @@ public final class SQLite3Jni {
     return type.isInstance(o) ? (T)o : null;
   }
 
-  public static native String sqlite3_column_origin_name(
+  public static synchronized native String sqlite3_column_origin_name(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native String sqlite3_column_table_name(
+  public static synchronized native String sqlite3_column_table_name(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
@@ -395,7 +395,7 @@ public final class SQLite3Jni {
      This API includes no functions for working with Java's Modified
      UTF-8.
   */
-  public static native String sqlite3_column_text16(
+  public static synchronized native String sqlite3_column_text16(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
@@ -403,7 +403,7 @@ public final class SQLite3Jni {
      Returns the given column's contents as UTF-8-encoded (not MUTF-8) text.
      Use sqlite3_column_text16() to fetch the text
   */
-  public static native byte[] sqlite3_column_text(
+  public static synchronized native byte[] sqlite3_column_text(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
@@ -444,11 +444,11 @@ public final class SQLite3Jni {
   //   return rv;
   // }
 
-  public static native int sqlite3_column_type(
+  public static synchronized native int sqlite3_column_type(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
-  public static native sqlite3_value sqlite3_column_value(
+  public static synchronized native sqlite3_value sqlite3_column_value(
     @NotNull sqlite3_stmt stmt, int ndx
   );
 
@@ -456,7 +456,7 @@ public final class SQLite3Jni {
      This functions like C's sqlite3_collation_needed16() because
      Java's string type is compatible with that interface.
   */
-  public static native int sqlite3_collation_needed(
+  public static synchronized native int sqlite3_collation_needed(
     @NotNull sqlite3 db, @Nullable CollationNeeded callback
   );
 
@@ -464,23 +464,23 @@ public final class SQLite3Jni {
      Returns the db handle passed to sqlite3_open() or
      sqlite3_open_v2(), as opposed to a new wrapper object.
   */
-  public static native sqlite3 sqlite3_context_db_handle(
+  public static synchronized native sqlite3 sqlite3_context_db_handle(
     @NotNull sqlite3_context cx
   );
 
-  public static native CommitHook sqlite3_commit_hook(
+  public static synchronized native CommitHook sqlite3_commit_hook(
     @NotNull sqlite3 db, @Nullable CommitHook hook
   );
 
-  public static native String sqlite3_compileoption_get(
+  public static synchronized native String sqlite3_compileoption_get(
     int n
   );
 
-  public static native boolean sqlite3_compileoption_used(
+  public static synchronized native boolean sqlite3_compileoption_used(
     @NotNull String optName
   );
 
-  public static native int sqlite3_create_collation(
+  public static synchronized native int sqlite3_create_collation(
     @NotNull sqlite3 db, @NotNull String name, int eTextRep,
     @NotNull Collation col
   );
@@ -493,16 +493,16 @@ public final class SQLite3Jni {
      SQLFunction's inner classes (Scalar, Aggregate<T>, and Window<T>)
      for details.
    */
-  public static native int sqlite3_create_function(
+  public static synchronized native int sqlite3_create_function(
     @NotNull sqlite3 db, @NotNull String functionName,
     int nArg, int eTextRep, @NotNull SQLFunction func
   );
 
-  public static native int sqlite3_data_count(
+  public static synchronized native int sqlite3_data_count(
     @NotNull sqlite3_stmt stmt
   );
 
-  public static native String sqlite3_db_filename(
+  public static synchronized native String sqlite3_db_filename(
     @NotNull sqlite3 db, @NotNull String dbName
   );
 
@@ -511,7 +511,7 @@ public final class SQLite3Jni {
      variadic arguments. Returns SQLITE_MISUSE if op is not one of the
      SQLITE_DBCONFIG_... options which uses this call form.
   */
-  public static native int sqlite3_db_config(
+  public static synchronized native int sqlite3_db_config(
     @NotNull sqlite3 db, int op, int onOff, @Nullable OutputPointer.Int32 out
   );
 
@@ -522,36 +522,36 @@ public final class SQLite3Jni {
      SQLITE_DBCONFIG_MAINDBNAME, but that set of options may be
      extended in future versions.
   */
-  public static native int sqlite3_db_config(
-    @NotNull sqlite3 db, int op, @NotNull String mainDbName
+  public static synchronized native int sqlite3_db_config(
+    @NotNull sqlite3 db, int op, @NotNull String val
   );
 
-  public static native int sqlite3_errcode(@NotNull sqlite3 db);
+  public static synchronized native int sqlite3_errcode(@NotNull sqlite3 db);
 
-  public static native int sqlite3_extended_errcode(@NotNull sqlite3 db);
+  public static synchronized native int sqlite3_extended_errcode(@NotNull sqlite3 db);
 
-  public static native boolean sqlite3_extended_result_codes(
+  public static synchronized native boolean sqlite3_extended_result_codes(
     @NotNull sqlite3 db, boolean onoff
   );
 
-  public static native String sqlite3_errmsg(@NotNull sqlite3 db);
+  public static synchronized native String sqlite3_errmsg(@NotNull sqlite3 db);
 
-  public static native String sqlite3_errstr(int resultCode);
+  public static synchronized native String sqlite3_errstr(int resultCode);
 
   /**
      Note that the offset values assume UTF-8-encoded SQL.
   */
-  public static native int sqlite3_error_offset(@NotNull sqlite3 db);
+  public static synchronized native int sqlite3_error_offset(@NotNull sqlite3 db);
 
-  public static native int sqlite3_finalize(@NotNull sqlite3_stmt stmt);
+  public static synchronized native int sqlite3_finalize(@NotNull sqlite3_stmt stmt);
 
-  public static native int sqlite3_initialize();
+  public static synchronized native int sqlite3_initialize();
 
-  public static native long sqlite3_last_insert_rowid(@NotNull sqlite3 db);
+  public static synchronized native long sqlite3_last_insert_rowid(@NotNull sqlite3 db);
 
-  public static native String sqlite3_libversion();
+  public static synchronized native String sqlite3_libversion();
 
-  public static native int sqlite3_libversion_number();
+  public static synchronized native int sqlite3_libversion_number();
 
   /**
      Works like its C counterpart and makes the native pointer of the
@@ -572,11 +572,11 @@ public final class SQLite3Jni {
      or sqlite3_open_v2() so that they have a predictible object to
      pass to, e.g., the sqlite3_collation_needed() callback.
   */
-  public static native synchronized int sqlite3_open(
+  public static synchronized native int sqlite3_open(
     @Nullable String filename, @NotNull OutputPointer.sqlite3 ppDb
   );
 
-  public static native synchronized int sqlite3_open_v2(
+  public static synchronized native int sqlite3_open_v2(
     @Nullable String filename, @NotNull OutputPointer.sqlite3 ppDb,
     int flags, @Nullable String zVfs
   );
@@ -600,7 +600,7 @@ public final class SQLite3Jni {
      necessary, however, and overloads are provided which gloss over
      that.
   */
-  private static native int sqlite3_prepare(
+  private static synchronized native int sqlite3_prepare(
     @NotNull sqlite3 db, @NotNull byte[] sqlUtf8, int maxBytes,
     @NotNull OutputPointer.sqlite3_stmt outStmt,
     @Nullable OutputPointer.Int32 pTailOffset
@@ -629,7 +629,7 @@ public final class SQLite3Jni {
     return sqlite3_prepare(db, utf8, utf8.length, outStmt, null);
   }
 
-  private static native int sqlite3_prepare_v2(
+  private static synchronized native int sqlite3_prepare_v2(
     @NotNull sqlite3 db, @NotNull byte[] sqlUtf8, int maxBytes,
     @NotNull OutputPointer.sqlite3_stmt outStmt,
     @Nullable OutputPointer.Int32 pTailOffset
@@ -658,7 +658,7 @@ public final class SQLite3Jni {
     return sqlite3_prepare_v2(db, utf8, utf8.length, outStmt, null);
   }
 
-  private static native int sqlite3_prepare_v3(
+  private static synchronized native int sqlite3_prepare_v3(
     @NotNull sqlite3 db, @NotNull byte[] sqlUtf8, int maxBytes,
     int prepFlags, @NotNull OutputPointer.sqlite3_stmt outStmt,
     @Nullable OutputPointer.Int32 pTailOffset
@@ -687,13 +687,13 @@ public final class SQLite3Jni {
     return sqlite3_prepare_v3(db, utf8, utf8.length, prepFlags, outStmt, null);
   }
 
-  public static native void sqlite3_progress_handler(
+  public static synchronized native void sqlite3_progress_handler(
     @NotNull sqlite3 db, int n, @Nullable ProgressHandler h
   );
 
   //TODO??? void *sqlite3_preupdate_hook(...) and friends
 
-  public static native int sqlite3_reset(@NotNull sqlite3_stmt stmt);
+  public static synchronized native int sqlite3_reset(@NotNull sqlite3_stmt stmt);
 
   /**
      Works like the C API except that it has no side effects if auto
@@ -701,7 +701,7 @@ public final class SQLite3Jni {
   */
   public static synchronized native void sqlite3_reset_auto_extension();
 
-  public static native void sqlite3_result_double(
+  public static synchronized native void sqlite3_result_double(
     @NotNull sqlite3_context cx, double v
   );
 
@@ -712,7 +712,7 @@ public final class SQLite3Jni {
      results in the C-level sqlite3_result_error() being called with
      a complaint about the invalid argument.
   */
-  private static native void sqlite3_result_error(
+  private static synchronized native void sqlite3_result_error(
     @NotNull sqlite3_context cx, @Nullable byte[] msg,
     int eTextRep
   );
@@ -755,27 +755,27 @@ public final class SQLite3Jni {
     sqlite3_result_error16(cx, e.getMessage());
   }
 
-  public static native void sqlite3_result_error_toobig(
+  public static synchronized native void sqlite3_result_error_toobig(
     @NotNull sqlite3_context cx
   );
 
-  public static native void sqlite3_result_error_nomem(
+  public static synchronized native void sqlite3_result_error_nomem(
     @NotNull sqlite3_context cx
   );
 
-  public static native void sqlite3_result_error_code(
+  public static synchronized native void sqlite3_result_error_code(
     @NotNull sqlite3_context cx, int c
   );
 
-  public static native void sqlite3_result_null(
+  public static synchronized native void sqlite3_result_null(
     @NotNull sqlite3_context cx
   );
 
-  public static native void sqlite3_result_int(
+  public static synchronized native void sqlite3_result_int(
     @NotNull sqlite3_context cx, int v
   );
 
-  public static native void sqlite3_result_int64(
+  public static synchronized native void sqlite3_result_int64(
     @NotNull sqlite3_context cx, long v
   );
 
@@ -795,7 +795,7 @@ public final class SQLite3Jni {
 
      Note that there is no sqlite3_bind_java_object() counterpart.
   */
-  public static native void sqlite3_result_java_object(
+  public static synchronized native void sqlite3_result_java_object(
     @NotNull sqlite3_context cx, @NotNull Object o
   );
 
@@ -853,19 +853,19 @@ public final class SQLite3Jni {
     sqlite3_result_text(cx, v);
   }
 
-  public static native void sqlite3_result_value(
+  public static synchronized native void sqlite3_result_value(
     @NotNull sqlite3_context cx, @NotNull sqlite3_value v
   );
 
-  public static native void sqlite3_result_zeroblob(
+  public static synchronized native void sqlite3_result_zeroblob(
     @NotNull sqlite3_context cx, int n
   );
 
-  public static native int sqlite3_result_zeroblob64(
+  public static synchronized native int sqlite3_result_zeroblob64(
     @NotNull sqlite3_context cx, long n
   );
 
-  private static native void sqlite3_result_blob(
+  private static synchronized native void sqlite3_result_blob(
     @NotNull sqlite3_context cx, @Nullable byte[] blob, int maxLen
   );
 
@@ -885,7 +885,7 @@ public final class SQLite3Jni {
      If maxLen is larger than blob.length, it is truncated to that
      value. If it is negative, results are undefined.
   */
-  private static native void sqlite3_result_blob64(
+  private static synchronized native void sqlite3_result_blob64(
     @NotNull sqlite3_context cx, @Nullable byte[] blob, long maxLen
   );
 
@@ -895,7 +895,7 @@ public final class SQLite3Jni {
     sqlite3_result_blob64(cx, blob, (long)(null==blob ? 0 : blob.length));
   }
 
-  private static native void sqlite3_result_text(
+  private static synchronized native void sqlite3_result_text(
     @NotNull sqlite3_context cx, @Nullable byte[] text, int maxLen
   );
 
@@ -929,7 +929,7 @@ public final class SQLite3Jni {
      text.length, it is silently truncated to text.length. If it is
      negative, results are undefined.
   */
-  private static native void sqlite3_result_text64(
+  private static synchronized native void sqlite3_result_text64(
     @NotNull sqlite3_context cx, @Nullable byte[] text,
     long maxLength, int encoding
   );
@@ -985,30 +985,30 @@ public final class SQLite3Jni {
     sqlite3_result_text64(cx, b, b.length, SQLITE_UTF16BE);
   }
 
-  public static native RollbackHook sqlite3_rollback_hook(
+  public static synchronized native RollbackHook sqlite3_rollback_hook(
     @NotNull sqlite3 db, @Nullable RollbackHook hook
   );
 
   //! Sets or unsets (if auth is null) the current authorizer.
-  public static native int sqlite3_set_authorizer(
+  public static synchronized native int sqlite3_set_authorizer(
     @NotNull sqlite3 db, @Nullable Authorizer auth
   );
 
-  public static native void sqlite3_set_last_insert_rowid(
+  public static synchronized native void sqlite3_set_last_insert_rowid(
     @NotNull sqlite3 db, long rowid
   );
 
-  public static native int sqlite3_sleep(int ms);
+  public static synchronized native int sqlite3_sleep(int ms);
 
-  public static native String sqlite3_sourceid();
+  public static synchronized native String sqlite3_sourceid();
 
-  public static native int sqlite3_step(@NotNull sqlite3_stmt stmt);
+  public static synchronized native int sqlite3_step(@NotNull sqlite3_stmt stmt);
 
   /**
      Internal impl of the public sqlite3_strglob() method. Neither argument
      may be NULL and both _MUST_ be NUL-terminated.
   */
-  private static native int sqlite3_strglob(
+  private static synchronized native int sqlite3_strglob(
     @NotNull byte[] glob, @NotNull byte[] txt
   );
 
@@ -1025,7 +1025,7 @@ public final class SQLite3Jni {
      Internal impl of the public sqlite3_strlike() method. Neither
      argument may be NULL and both _MUST_ be NUL-terminated.
   */
-  private static native int sqlite3_strlike(
+  private static synchronized native int sqlite3_strlike(
     @NotNull byte[] glob, @NotNull byte[] txt, int escChar
   );
 
@@ -1039,11 +1039,11 @@ public final class SQLite3Jni {
     );
   }
 
-  public static native int sqlite3_threadsafe();
+  public static synchronized native int sqlite3_threadsafe();
 
-  public static native int sqlite3_total_changes(@NotNull sqlite3 db);
+  public static synchronized native int sqlite3_total_changes(@NotNull sqlite3 db);
 
-  public static native long sqlite3_total_changes64(@NotNull sqlite3 db);
+  public static synchronized native long sqlite3_total_changes64(@NotNull sqlite3 db);
 
   /**
      Works like C's sqlite3_trace_v2() except that the 3rd argument to that
@@ -1055,33 +1055,33 @@ public final class SQLite3Jni {
      mapping state fails and SQLITE_ERROR if the given callback object
      cannot be processed propertly (i.e. an internal error).
   */
-  public static native int sqlite3_trace_v2(
+  public static synchronized native int sqlite3_trace_v2(
     @NotNull sqlite3 db, int traceMask, @Nullable Tracer tracer
   );
 
-  public static native UpdateHook sqlite3_update_hook(
+  public static synchronized native UpdateHook sqlite3_update_hook(
     sqlite3 db, UpdateHook hook
   );
 
-  public static native byte[] sqlite3_value_blob(@NotNull sqlite3_value v);
+  public static synchronized native byte[] sqlite3_value_blob(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_bytes(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_bytes(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_bytes16(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_bytes16(@NotNull sqlite3_value v);
 
-  public static native double sqlite3_value_double(@NotNull sqlite3_value v);
+  public static synchronized native double sqlite3_value_double(@NotNull sqlite3_value v);
 
-  public static native sqlite3_value sqlite3_value_dupe(
+  public static synchronized native sqlite3_value sqlite3_value_dupe(
     @NotNull sqlite3_value v
   );
 
-  public static native int sqlite3_value_encoding(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_encoding(@NotNull sqlite3_value v);
 
-  public static native void sqlite3_value_free(@Nullable sqlite3_value v);
+  public static synchronized native void sqlite3_value_free(@Nullable sqlite3_value v);
 
-  public static native int sqlite3_value_int(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_int(@NotNull sqlite3_value v);
 
-  public static native long sqlite3_value_int64(@NotNull sqlite3_value v);
+  public static synchronized native long sqlite3_value_int64(@NotNull sqlite3_value v);
 
   /**
      If the given value was set using sqlite3_result_java_value() then
@@ -1090,7 +1090,7 @@ public final class SQLite3Jni {
      It is up to the caller to inspect the object to determine its
      type, and cast it if necessary.
   */
-  public static native Object sqlite3_value_java_object(
+  public static synchronized native Object sqlite3_value_java_object(
     @NotNull sqlite3_value v
   );
 
@@ -1111,41 +1111,41 @@ public final class SQLite3Jni {
      See sqlite3_value_text_utf8() for how to extract text in standard
      UTF-8.
   */
-  public static native String sqlite3_value_text(@NotNull sqlite3_value v);
+  public static synchronized native String sqlite3_value_text(@NotNull sqlite3_value v);
 
   /**
      The sqlite3_value counterpart of sqlite3_column_text_utf8().
   */
-  public static native byte[] sqlite3_value_text_utf8(@NotNull sqlite3_value v);
+  public static synchronized native byte[] sqlite3_value_text_utf8(@NotNull sqlite3_value v);
 
-  public static native byte[] sqlite3_value_text16(@NotNull sqlite3_value v);
+  public static synchronized native byte[] sqlite3_value_text16(@NotNull sqlite3_value v);
 
-  public static native byte[] sqlite3_value_text16le(@NotNull sqlite3_value v);
+  public static synchronized native byte[] sqlite3_value_text16le(@NotNull sqlite3_value v);
 
-  public static native byte[] sqlite3_value_text16be(@NotNull sqlite3_value v);
+  public static synchronized native byte[] sqlite3_value_text16be(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_type(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_type(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_numeric_type(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_numeric_type(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_nochange(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_nochange(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_frombind(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_frombind(@NotNull sqlite3_value v);
 
-  public static native int sqlite3_value_subtype(@NotNull sqlite3_value v);
+  public static synchronized native int sqlite3_value_subtype(@NotNull sqlite3_value v);
 
   /**
      Cleans up all per-JNIEnv and per-db state managed by the library
      then calls the C-native sqlite3_shutdown().
   */
-  public static native int sqlite3_shutdown();
+  public static synchronized native int sqlite3_shutdown();
 
   /**
      This is NOT part of the public API. It exists solely as a place
      to hook in arbitrary C-side code during development and testing
      of this library.
    */
-  static native void sqlite3_do_something_for_developer();
+  static synchronized native void sqlite3_do_something_for_developer();
 
   //////////////////////////////////////////////////////////////////////
   // SQLITE_... constants follow...
index 4df8a748e2fb947e594da199cc76a93cb1ed0197..43b3d62dedd282cab37942d062a79e4ada4a8141 100644 (file)
@@ -57,7 +57,7 @@ public final class fts5_api extends NativePointerHolder<fts5_api> {
   //   void (*xDestroy)(void*)
   // );
 
-  public native int xCreateFunction(@NotNull String name,
+  public synchronized native int xCreateFunction(@NotNull String name,
                                     @Nullable Object userData,
                                     @NotNull fts5_extension_function xFunction);
 
index c3653aa4acb1dd0ac7ede73ad6926482c6ac481a..4016d956874100c9f2250940d01771b0847ea897 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Work\saround\sjdk8\sand\sjdk19\smangling\sthe\sC\sname\sof\ssqlite3_db_config()\sdifferently.\sCorrect\sthe\svariadic\sarg\shandling\sof\sthe\sJNI-side\ssubset\sof\ssqlite3_db_config()\soptions.
-D 2023-08-10T21:29:59.469
+C Mark\s_all_\sJNI\sbinding\sfuncs\sas\ssynchronized\sso\sthat\sJava\scan\slock\sthem\sand\sprotect\sour\sglobal-state\saccess.\sThe\salternative\sis\swriting\sa\smountain\sof\sC-side\scode\sto\sdo\sthe\ssame\sthing.
+D 2023-08-10T21:50:52.042
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -244,7 +244,7 @@ F ext/jni/src/org/sqlite/jni/CollationNeeded.java ad67843b6dd1c06b6b0a1dc72887b7
 F ext/jni/src/org/sqlite/jni/CommitHook.java 87c6a8e5138c61a8eeff018fe16d23f29219150239746032687f245938baca1a
 F ext/jni/src/org/sqlite/jni/Fts5.java 13844685231e8b4840a706db3bed84d5dfcf15be0ae7e809eac40420dba24901
 F ext/jni/src/org/sqlite/jni/Fts5Context.java 0a5a02047a6a1dd3e4a38b0e542a8dd2de365033ba30e6ae019a676305959890
-F ext/jni/src/org/sqlite/jni/Fts5ExtensionApi.java c908e5fdf6f5d15e388144fcd8160a3f46c18dade749f1b747122d2d37f2e726
+F ext/jni/src/org/sqlite/jni/Fts5ExtensionApi.java 01f890105c6b7edbbad1c0f5635f783cea62c4b2ae694a71e76514a936ee03ec
 F ext/jni/src/org/sqlite/jni/Fts5Function.java 65cde7151e441fee012250a5e03277de7babcd11a0c308a832b7940574259bcc
 F ext/jni/src/org/sqlite/jni/Fts5PhraseIter.java 6642beda341c0b1b46af4e2d7f6f9ab03a7aede43277b2c92859176d6bce3be9
 F ext/jni/src/org/sqlite/jni/Fts5Tokenizer.java 91489893596b6528c0df5cd7180bd5b55809c26e2b797fb321dfcdbc1298c060
@@ -254,13 +254,13 @@ F ext/jni/src/org/sqlite/jni/ProgressHandler.java 6f62053a828a572de809828b1ee495
 F ext/jni/src/org/sqlite/jni/ResultCode.java 7cdf993f2037ab7bd244c9a34dbaef2ace3beb5da5d7e7fda5c6f67634ceb647
 F ext/jni/src/org/sqlite/jni/RollbackHook.java b04c8abcc6ade44a8a57129e33765793f69df0ba909e49ba18d73f4268d92564
 F ext/jni/src/org/sqlite/jni/SQLFunction.java 09ce81c1c637e31c3a830d4c859cce95d65f5e02ff45f8bd1985b3479381bc46
-F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 038401cac290a0641a0db33aada8941314f81c03f583a7fb18c88d24917a1757
+F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 836822ecf2f346d2218609fa68ddb3b595361663890493271635726e776cb57b
 F ext/jni/src/org/sqlite/jni/Tester1.java c45ab1895774851dec30824157d4c390f49e17729588c02cd88172854ee97e74
 F ext/jni/src/org/sqlite/jni/TesterFts5.java cf2d687baafffdeba219b77cf611fd47a0556248820ea794ae3e8259bfbdc5ee
 F ext/jni/src/org/sqlite/jni/Tracer.java a5cece9f947b0af27669b8baec300b6dd7ff859c3e6a6e4a1bd8b50f9714775d
 F ext/jni/src/org/sqlite/jni/UpdateHook.java e58645a1727f8a9bbe72dc072ec5b40d9f9362cb0aa24acfe93f49ff56a9016d
 F ext/jni/src/org/sqlite/jni/ValueHolder.java f022873abaabf64f3dd71ab0d6037c6e71cece3b8819fa10bf26a5461dc973ee
-F ext/jni/src/org/sqlite/jni/fts5_api.java 8c6b32455d7f85ee3f7f3e71c148bb3c2106f1d5484017daddfd560dd69d4f66
+F ext/jni/src/org/sqlite/jni/fts5_api.java 5198be71c162e3e0cb1f4962a7cdf0d7596e8af53f70c4af6db24aab8d53d9ba
 F ext/jni/src/org/sqlite/jni/fts5_extension_function.java ac825035d7d83fc7fd960347abfa6803e1614334a21533302041823ad5fc894c
 F ext/jni/src/org/sqlite/jni/fts5_tokenizer.java e530b36e6437fcc500e95d5d75fbffe272bdea20d2fac6be2e1336c578fba98b
 F ext/jni/src/org/sqlite/jni/sqlite3.java 62b1b81935ccf3393472d17cb883dc5ff39c388ec3bc1de547f098a0217158fc
@@ -2090,8 +2090,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P d6a4d212ceba662470d8957b6a8d7075d18a84bd0d3e13ce7adcab03604fc3b7
-R f64708a8113a281fcc5d61dfd9215f40
+P 746894c3c043c47f8b4c231de8921df81c5d0634260d299359bea73132dc7867
+R e1ccd8a6a6627664a18e71218906f2ad
 U stephan
-Z 8c35114ab07dc03c5df44ce3aa4b9338
+Z 898733fffb725ecf1391b4a8e291674e
 # Remove this line to create a well-formed Fossil manifest.
index bd45f5cb0fbbc0de27f296deb3767fba9d1a26f0..8bcfadfae99e778710178cf12b300ddb84493348 100644 (file)
@@ -1 +1 @@
-746894c3c043c47f8b4c231de8921df81c5d0634260d299359bea73132dc7867
\ No newline at end of file
+afe190a940441de9bef8835c2dc6d278f861a772c3b7c7a2d399b2eabd4872e3
\ No newline at end of file