/ Check-in [2b9340c8]
Login

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

Overview
Comment:Remove a small amount of unnecessary #ifdeffery from random.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2b9340c8684bc382391e02813e960b3166f24daa
User & Date: drh 2014-10-27 20:14:02
Context
2014-10-27
22:06
Add special handling for static mutexes in sqlite3_mutex_alloc() when automatic calls to sqlite3_initialize() are enabled. check-in: 7857d27c user: mistachkin tags: trunk
20:14
Remove a small amount of unnecessary #ifdeffery from random.c. check-in: 2b9340c8 user: drh tags: trunk
19:58
Fix compilation issue with MSVC due to a misplaced variable declaration. check-in: 9588b345 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/random.c.

    53     53   
    54     54   #ifndef SQLITE_OMIT_AUTOINIT
    55     55     if( sqlite3_initialize() ) return;
    56     56   #endif
    57     57   
    58     58   #if SQLITE_THREADSAFE
    59     59     mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
    60         -  sqlite3_mutex_enter(mutex);
    61     60   #endif
    62     61   
           62  +  sqlite3_mutex_enter(mutex);
    63     63     if( N<=0 || pBuf==0 ){
    64     64       wsdPrng.isInit = 0;
    65         -#if SQLITE_THREADSAFE
    66     65       sqlite3_mutex_leave(mutex);
    67         -#endif
    68     66       return;
    69     67     }
    70     68   
    71     69     /* Initialize the state of the random number generator once,
    72     70     ** the first time this routine is called.  The seed value does
    73     71     ** not need to contain a lot of randomness since we are not
    74     72     ** trying to do secure encryption or anything like that...