~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/catalog/cache.cc

  • Committer: Olaf van der Spek
  • Date: 2011-02-28 14:09:50 UTC
  • mfrom: (2207 bootstrap)
  • mto: (2209.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2210.
  • Revision ID: olafvdspek@gmail.com-20110228140950-2nu0hyzhuww3wssx
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
Instance::shared_ptr Cache::find(const identifier::Catalog &identifier, drizzled::error_t &error)
30
30
{
31
31
  boost::mutex::scoped_lock scopedLock(_mutex);
32
 
  if (const unordered_map::mapped_type* i= find_ptr(cache, identifier))
 
32
  if (const unordered_map::mapped_type* ptr= find_ptr(cache, identifier))
33
33
  {
34
 
    error= *i ? EE_OK : ER_CATALOG_NO_LOCK;
35
 
    return *i;
 
34
    error= *ptr ? EE_OK : ER_CATALOG_NO_LOCK;
 
35
    return *ptr;
36
36
  }
37
37
  error= ER_CATALOG_DOES_NOT_EXIST;
38
38
  return catalog::Instance::shared_ptr();
60
60
bool Cache::unlock(const identifier::Catalog &identifier, drizzled::error_t &error)
61
61
{
62
62
  boost::mutex::scoped_lock scopedLock(_mutex);
63
 
  if (const unordered_map::mapped_type* i= find_ptr(cache, identifier))
 
63
  if (const unordered_map::mapped_type* ptr= find_ptr(cache, identifier))
64
64
  {
65
 
    if (not *i)
 
65
    if (not *ptr)
66
66
    {
67
67
      if (cache.erase(identifier))
68
68
        return true;