aboutsummaryrefslogtreecommitdiff
path: root/src/os_win.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-09-01 17:36:46 +0000
committerdrh <drh@noemail.net>2014-09-01 17:36:46 +0000
commit0f8f26716cc3d1fa848f798756f6488f4c3760d3 (patch)
tree62d0661166f82cc41d6a3635cf244579e18606ee /src/os_win.c
parent19541f3018295f89a57931917539d1ea2fa93eff (diff)
parent6b2129aaaf69c4318d4dc158b685e4522c4bf633 (diff)
downloadsqlite-0f8f26716cc3d1fa848f798756f6488f4c3760d3.tar.gz
sqlite-0f8f26716cc3d1fa848f798756f6488f4c3760d3.zip
Add support for using separate worker threads to speed large sorts.
The SQLITE_MAX_WORKER_THREADS and SQLITE_DEFAULT_WORKER_THREADS compile-time options and the SQLITE_LIMIT_WORKER_THREADS argument to sqlite3_limit() and the "PRAGMA threads=N" pragma are added. FossilOrigin-Name: b1c0f0bc1bd8a3477cd7a7ab510f0442ac88b517
Diffstat (limited to 'src/os_win.c')
-rw-r--r--src/os_win.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/os_win.c b/src/os_win.c
index b9f13becd..7ffe18059 100644
--- a/src/os_win.c
+++ b/src/os_win.c
@@ -943,11 +943,7 @@ static struct win_syscall {
#define osWaitForSingleObject ((DWORD(WINAPI*)(HANDLE, \
DWORD))aSyscall[63].pCurrent)
-#if SQLITE_OS_WINRT
{ "WaitForSingleObjectEx", (SYSCALL)WaitForSingleObjectEx, 0 },
-#else
- { "WaitForSingleObjectEx", (SYSCALL)0, 0 },
-#endif
#define osWaitForSingleObjectEx ((DWORD(WINAPI*)(HANDLE,DWORD, \
BOOL))aSyscall[64].pCurrent)
@@ -1290,6 +1286,13 @@ void sqlite3_win32_sleep(DWORD milliseconds){
#endif
}
+DWORD sqlite3Win32Wait(HANDLE hObject){
+ DWORD rc;
+ while( (rc = osWaitForSingleObjectEx(hObject, INFINITE,
+ TRUE))==WAIT_IO_COMPLETION ){}
+ return rc;
+}
+
/*
** Return true (non-zero) if we are running under WinNT, Win2K, WinXP,
** or WinCE. Return false (zero) for Win95, Win98, or WinME.