FreeBSD/contrib/subversion/subversion/libsvn_subr/sqlite.c
/* Don't call this function directly!  Use svn_atomic__init_once(). */
Don't call this function directly.
Don ' t call this function directly .
static svn_error_t *
init_sqlite(void *baton, apr_pool_t *pool)
{
  if (sqlite3_libversion_number() < SVN_SQLITE_MIN_VERSION_NUMBER)
    {
      return svn_error_createf(
                    SVN_ERR_SQLITE_ERROR, NULL,
                    _("SQLite compiled for %s, but running with %s"),
                    SVN_SQLITE_MIN_VERSION, sqlite3_libversion());
    }
#if APR_HAS_THREADS
  if (! sqlite3_threadsafe())
    return svn_error_create(SVN_ERR_SQLITE_ERROR, NULL,
                            _("SQLite is required to be compiled and run in "
                              "thread-safe mode"));
  {
    int err = sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
    if (err != SQLITE_OK && err != SQLITE_MISUSE)
      return svn_error_createf(SQLITE_ERROR_CODE(err), NULL,
                               _("Could not configure SQLite [S%d]"), err);
  }
  SQLITE_ERR_MSG(sqlite3_initialize(), _("Could not initialize SQLite"));
#endif 
  return SVN_NO_ERROR;
}
static svn_error_t * init_sqlite ( void * baton , apr_pool_t * pool ) { if ( sqlite3_libversion_number ( ) < SVN_SQLITE_MIN_VERSION_NUMBER ) { return svn_error_createf ( SVN_ERR_SQLITE_ERROR , NULL , _ ( " " ) , SVN_SQLITE_MIN_VERSION , sqlite3_libversion ( ) ) ; } #if APR_HAS_THREADS if ( ! sqlite3_threadsafe ( ) ) return svn_error_create ( SVN_ERR_SQLITE_ERROR , NULL , _ ( " " " " ) ) ; { int err = sqlite3_config ( SQLITE_CONFIG_MULTITHREAD ) ; if ( err != SQLITE_OK && err != SQLITE_MISUSE ) return svn_error_createf ( SQLITE_ERROR_CODE ( err ) , NULL , _ ( " " ) , err ) ; } SQLITE_ERR_MSG ( sqlite3_initialize ( ) , _ ( " " ) ) ; #endif return SVN_NO_ERROR ; }
Don't call this function directly!
Don ' t call this function directly!
/* SQLite 3.5 allows verification of its thread-safety at runtime.
     Older versions are simply expected to have been configured with
     --enable-threadsafe, which compiles with -DSQLITE_THREADSAFE=1
     (or -DTHREADSAFE, for older versions). */ /* If SQLite has been already initialized, sqlite3_config() returns
     SQLITE_MISUSE. */ /* APR_HAS_THRADS */