/ Check-in [d7bfb960]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove an assert in the windows worker-thread logic that can fail in a race condition.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d7bfb96092a6b812af194f32b22283a0f6a7da96
User & Date: drh 2015-09-26 01:28:46
Context
2015-09-26
03:23
Expand the header comment to clarify the purpose for the sqlite3MemoryBarrier() function. check-in: b89495ae user: drh tags: trunk
01:28
Remove an assert in the windows worker-thread logic that can fail in a race condition. check-in: d7bfb960 user: drh tags: trunk
2015-09-25
23:40
Fix threads.c so that setting sqlite3FaultSim(200) using the SQLITE_TESTCTRL_FAULT_INSTALL callback causes both unix and windows worker threads to be sequential and deterministic, so that they can be tested reliably. check-in: 2d867c05 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/threads.c.

184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
  DWORD rc;
  BOOL bRc;

  assert( ppOut!=0 );
  if( NEVER(p==0) ) return SQLITE_NOMEM;
  if( p->xTask==0 ){
    assert( p->id==GetCurrentThreadId() );
    rc = WAIT_OBJECT_0;
    assert( p->tid==0 );
  }else{
    assert( p->id!=0 && p->id!=GetCurrentThreadId() );
    rc = sqlite3Win32Wait((HANDLE)p->tid);
    assert( rc!=WAIT_IO_COMPLETION );
    bRc = CloseHandle((HANDLE)p->tid);







|







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
int sqlite3ThreadJoin(SQLiteThread *p, void **ppOut){
  DWORD rc;
  BOOL bRc;

  assert( ppOut!=0 );
  if( NEVER(p==0) ) return SQLITE_NOMEM;
  if( p->xTask==0 ){
    /* assert( p->id==GetCurrentThreadId() ); */
    rc = WAIT_OBJECT_0;
    assert( p->tid==0 );
  }else{
    assert( p->id!=0 && p->id!=GetCurrentThreadId() );
    rc = sqlite3Win32Wait((HANDLE)p->tid);
    assert( rc!=WAIT_IO_COMPLETION );
    bRc = CloseHandle((HANDLE)p->tid);