SQLite

Check-in [f8e98ab306]
Login

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

Overview
Comment:Suppress unused parameter warnings in sqlite3VdbeEnter() and related routines.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f8e98ab3062a6e56924a86e8f3204c30d0f3d906
User & Date: drh 2011-04-04 03:27:16.245
Context
2011-04-04
07:05
Changes to oserror.test and syscall.test so that they work with the in-memory journal permutation test. (check-in: 4e996f36c7 user: dan tags: trunk)
03:27
Suppress unused parameter warnings in sqlite3VdbeEnter() and related routines. (check-in: f8e98ab306 user: drh tags: trunk)
00:14
Remove the BtreeMutexArray object - use the Vdbe.btreeMask field to accomplish the same result. Add a generation counter to btree mutexes in order to assert that mutexes are never temporarily dropped over a range of instructions in order to do deadlock avoidance in some subroutine. Lock all btrees in any Vdbe program that uses OP_ParseSchema. (check-in: d81708f7d1 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeaux.c.
974
975
976
977
978
979
980


981
982
983
984
985
986
987
  Db *aDb = db->aDb;
  int nDb = db->nDb;
  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      cntSum += sqlite3BtreeMutexCounter(aDb[i].pBt);
    }
  }


#endif
  return cntSum;
}
#endif

/*
** If SQLite is compiled to support shared-cache mode and to be threadsafe,







>
>







974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
  Db *aDb = db->aDb;
  int nDb = db->nDb;
  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      cntSum += sqlite3BtreeMutexCounter(aDb[i].pBt);
    }
  }
#else
  UNUSED_PARAMETER(p);
#endif
  return cntSum;
}
#endif

/*
** If SQLite is compiled to support shared-cache mode and to be threadsafe,
1013
1014
1015
1016
1017
1018
1019


1020
1021
1022
1023
1024
1025
1026
  int nDb = db->nDb;
  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeEnter(aDb[i].pBt);
    }
  }
  p->iMutexCounter = mutexCounterSum(p);


#endif
}

/*
** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
*/
void sqlite3VdbeLeave(Vdbe *p){







>
>







1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
  int nDb = db->nDb;
  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeEnter(aDb[i].pBt);
    }
  }
  p->iMutexCounter = mutexCounterSum(p);
#else
  UNUSED_PARAMETER(p);
#endif
}

/*
** Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
*/
void sqlite3VdbeLeave(Vdbe *p){
1037
1038
1039
1040
1041
1042
1043


1044
1045
1046
1047
1048
1049
1050
  assert( mutexCounterSum(p) == p->iMutexCounter );

  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeLeave(aDb[i].pBt);
    }
  }


#endif
}

/*
** Recompute the sum of the mutex counters on all btrees used by the
** prepared statement p.
**







>
>







1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
  assert( mutexCounterSum(p) == p->iMutexCounter );

  for(i=0, mask=1; i<nDb; i++, mask += mask){
    if( i!=1 && (mask & p->btreeMask)!=0 && ALWAYS(aDb[i].pBt!=0) ){
      sqlite3BtreeLeave(aDb[i].pBt);
    }
  }
#else
  UNUSED_PARAMETER(p);
#endif
}

/*
** Recompute the sum of the mutex counters on all btrees used by the
** prepared statement p.
**
1061
1062
1063
1064
1065
1066
1067


1068
1069
1070
1071
1072
1073
1074
** mutexes in the prepared statement might have been released and reacquired.
** So checks to verify that mutex-protected content did not change
** unexpectedly should accompany any call to this routine.
*/
void sqlite3VdbeMutexResync(Vdbe *p){
#if !defined(SQLITE_OMIT_SHARED_CACHE) && defined(SQLITE_DEBUG)
  p->iMutexCounter = mutexCounterSum(p);


#endif
}

#if defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
/*
** Print a single opcode.  This routine is used for debugging only.
*/







>
>







1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
** mutexes in the prepared statement might have been released and reacquired.
** So checks to verify that mutex-protected content did not change
** unexpectedly should accompany any call to this routine.
*/
void sqlite3VdbeMutexResync(Vdbe *p){
#if !defined(SQLITE_OMIT_SHARED_CACHE) && defined(SQLITE_DEBUG)
  p->iMutexCounter = mutexCounterSum(p);
#else
  UNUSED_PARAMETER(p);
#endif
}

#if defined(VDBE_PROFILE) || defined(SQLITE_DEBUG)
/*
** Print a single opcode.  This routine is used for debugging only.
*/