IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16696


Ignore:
Timestamp:
Feb 27, 2008, 4:13:03 PM (18 years ago)
Author:
jhoblitt
Message:

re-enable thread safety in p_psDBRunQueryPrepared()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r16695 r16696  
    2323 * 4.1.2 or newer is required.
    2424 *
    25  * $Id: psDB.c,v 1.150 2008-02-28 02:02:47 jhoblitt Exp $
     25 * $Id: psDB.c,v 1.151 2008-02-28 02:13:03 jhoblitt Exp $
    2626 */
    2727
     
    8080
    8181// cache of prepared query statements
    82 // static pthread_mutex_t preparedQueryMutex = PTHREAD_MUTEX_INITIALIZER;
     82static pthread_mutex_t preparedQueryMutex = PTHREAD_MUTEX_INITIALIZER;
    8383static psHash *preparedQuery = NULL;
    8484
     
    857857
    858858    // start lock on query cache
    859 //    if (psMemGetThreadSafety()) {
    860 //        pthread_mutex_lock(&preparedQueryMutex);
    861 //    }
     859    if (psMemGetThreadSafety()) {
     860        pthread_mutex_lock(&preparedQueryMutex);
     861    }
    862862
    863863    // initalize the prepared query cache
    864864    if (!preparedQuery) {
    865865        preparedQuery = psHashAlloc(10);
     866        psMemSetPersistent(preparedQuery, true);
    866867    }
    867868
     
    891892
    892893            // end lock on query cache
    893 //            if (psMemGetThreadSafety()) {
    894 //                pthread_mutex_unlock(&preparedQueryMutex);
    895 //            }
     894            if (psMemGetThreadSafety()) {
     895                pthread_mutex_unlock(&preparedQueryMutex);
     896            }
    896897
    897898            return -1;
     
    905906
    906907    // end lock on query cache
    907 //    if (psMemGetThreadSafety()) {
    908 //        pthread_mutex_unlock(&preparedQueryMutex);
    909 //    }
     908    if (psMemGetThreadSafety()) {
     909        pthread_mutex_unlock(&preparedQueryMutex);
     910    }
    910911
    911912    psFree(query);
Note: See TracChangeset for help on using the changeset viewer.