示例#1
0
        internal static void FinishBackup(SQLiteConnectionHandle hdl, IntPtr backup)
        {
            if ((hdl == null) || (backup == IntPtr.Zero))
            {
                return;
            }

            try
            {
                // do nothing.
            }
            finally /* NOTE: Thread.Abort() protection. */
            {
#if PLATFORM_COMPACTFRAMEWORK
                lock (hdl.syncRoot)
#else
                lock (hdl)
#endif
                {
#if !SQLITE_STANDARD
                    SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_backup_finish_interop(backup);
#else
                    SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_backup_finish(backup);
#endif
                    if (n != SQLiteErrorCode.Ok)
                    {
                        throw new SQLiteException(n, null);
                    }
                }
            }
        }