SQLite

Check-in [b126013b5a]
Login

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

Overview
Comment:Added assert to verify winMutex system is inited before "static" mutexes are used. (CVS 6701)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b126013b5a1d6526810139d19acbec7fd0ab8168
User & Date: shane 2009-06-01 17:10:22.000
Context
2009-06-01
18:18
Malloc for space to hold the Parse object in sqlite3_prepare() and friends. Or, if compiled with SQLITE_USE_ALLOCA, obtain space for the object from alloca(). (CVS 6702) (check-in: c7c0c58e47 user: drh tags: trunk)
17:10
Added assert to verify winMutex system is inited before "static" mutexes are used. (CVS 6701) (check-in: b126013b5a user: shane tags: trunk)
17:06
Ensure that "static" mutexes are deleted on shutdown so that they are not leaked across restarts. (CVS 6700) (check-in: 4e75897ee1 user: shane tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/mutex_w32.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
** 2007 August 14
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains the C functions that implement mutexes for win32
**
** $Id: mutex_w32.c,v 1.16 2009/06/01 17:06:08 shane Exp $
*/
#include "sqliteInt.h"

/*
** The code in this file is only used if we are compiling multithreaded
** on a win32 system.
*/













|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
** 2007 August 14
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains the C functions that implement mutexes for win32
**
** $Id: mutex_w32.c,v 1.17 2009/06/01 17:10:22 shane Exp $
*/
#include "sqliteInt.h"

/*
** The code in this file is only used if we are compiling multithreaded
** on a win32 system.
*/
171
172
173
174
175
176
177

178
179
180
181
182
183
184
      if( p ){  
        p->id = iType;
        InitializeCriticalSection(&p->mutex);
      }
      break;
    }
    default: {

      assert( iType-2 >= 0 );
      assert( iType-2 < sizeof(winMutex_staticMutexes)/sizeof(winMutex_staticMutexes[0]) );
      p = &winMutex_staticMutexes[iType-2];
      p->id = iType;
      break;
    }
  }







>







171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
      if( p ){  
        p->id = iType;
        InitializeCriticalSection(&p->mutex);
      }
      break;
    }
    default: {
      assert( winMutex_isInit==1 );
      assert( iType-2 >= 0 );
      assert( iType-2 < sizeof(winMutex_staticMutexes)/sizeof(winMutex_staticMutexes[0]) );
      p = &winMutex_staticMutexes[iType-2];
      p->id = iType;
      break;
    }
  }