/ Check-in [b126013b]
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 | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b126013b5a1d6526810139d19acbec7fd0ab8168
User & Date: shane 2009-06-01 17:10:22
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: c7c0c58e user: drh tags: trunk
17:10
Added assert to verify winMutex system is inited before "static" mutexes are used. (CVS 6701) check-in: b126013b 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: 4e75897e user: shane tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/mutex_w32.c.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
171
172
173
174
175
176
177

178
179
180
181
182
183
184
**    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.
*/
................................................................................
      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;
    }
  }







|







 







>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
**    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.
*/
................................................................................
      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;
    }
  }