**
*************************************************************************
**
-** $Id: sqlite3async.c,v 1.5 2009/04/29 18:12:00 shane Exp $
+** $Id: sqlite3async.c,v 1.6 2009/04/30 17:45:34 shane Exp $
**
** This file contains the implementation of an asynchronous IO backend
** for SQLite.
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO)
#include "sqlite3async.h"
-#include "sqliteInt.h"
+#include "sqlite3.h"
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)>(y)?(x):(y))
+#ifndef SQLITE_AMALGAMATION
+/* Macro to mark parameters as unused and silence compiler warnings. */
+#define UNUSED_PARAMETER(x) (void)(x)
+#endif
+
/* Forward references */
typedef struct AsyncWrite AsyncWrite;
typedef struct AsyncFile AsyncFile;
*/
#if SQLITE_OS_WIN || defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
+#include <windows.h>
+
/* The following block contains the win32 specific code. */
#define mutex_held(X) (GetCurrentThreadId()==primitives.aHolder[X])
SetEvent(primitives.aCond[eCond]);
}
static void async_sched_yield(void){
- /* Todo: Find out if win32 offers anything like sched_yield() */
Sleep(0);
}
#else
if( iBeginIn<0 ) iBeginIn = 0;
if( iBeginOut<0 ) iBeginOut = 0;
- nCopy = MIN(pWrite->nByte-iBeginIn, iAmt-iBeginOut);
+ nCopy = (int)MIN(pWrite->nByte-iBeginIn, iAmt-iBeginOut);
if( nCopy>0 ){
memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], nCopy);
async_mutex_enter(ASYNC_MUTEX_QUEUE);
- /* Read the filesystem size from the base file. If pBaseRead is NULL, this
+ /* Read the filesystem size from the base file. If pMethods is NULL, this
** means the file hasn't been opened yet. In this case all relevant data
** must be in the write-op queue anyway, so we can omit reading from the
** file-system.
-C Disable\san\salways-false\stest\sin\sthe\sattach.c\smodule.\s(CVS\s6581)
-D 2009-04-30T17:38:38
+C More\scleanup,\setc.\sto\ssupport\sMSVC\scompiles.\s(CVS\s6582)
+D 2009-04-30T17:45:34
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F doc/report1.txt a031aaf37b185e4fa540223cb516d3bccec7eeac
F ext/README.txt 913a7bd3f4837ab14d7e063304181787658b14e1
F ext/async/README.txt 0c541f418b14b415212264cbaaf51c924ec62e5b
-F ext/async/sqlite3async.c 207af6692a52cf1dc3a9e64c93dcd7f7a7db0a6f
+F ext/async/sqlite3async.c a10dd8add8544c62faf1b6eccb6b1e535b5e7cad
F ext/async/sqlite3async.h b6d74dbf9aa5a0ac4e79aa15a4d987f3552a0f75
F ext/fts1/README.txt 20ac73b006a70bcfd80069bdaf59214b6cf1db5e
F ext/fts1/ft_hash.c 3927bd880e65329bdc6f506555b228b28924921b
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P d67af3f5a21329e133aa6cf2be745a9f8c1a6562
-R 1053ef59038cf5f36f9be3b18c891400
-U drh
-Z f5c5a2a7db3916e075df663b238c5cc6
+P 92b69481bd0eedf06599c40623b38a6f4990010a
+R 1fb8411f09203d4b0b597f4bb4bb4448
+U shane
+Z c3fcacee57f0e52fd4f695bca1750e29