~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/cache.cc

  • Committer: Lee Bieber
  • Date: 2011-04-14 16:20:43 UTC
  • mfrom: (2277.1.3 build)
  • Revision ID: kalebral@gmail.com-20110414162043-2khq8mql7gvodnzn
Merge Olaf - Refactor Session Cache and Remove table::Cache::singleton()
Merge Olaf - Refactor Thread
Merge Olaf - remove unused functions

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
table::shared_ptr Cache::find(const identifier::Table &identifier)
30
30
{
31
 
  boost_unique_lock_t scoped_lock(_access);
 
31
  boost::mutex::scoped_lock scoped_lock(_access);
32
32
  if (Map::mapped_type* ptr= find_ptr(cache, identifier.getKey()))
33
33
    return *ptr;
34
34
  return table::shared_ptr();
36
36
 
37
37
void Cache::erase(const identifier::Table &identifier)
38
38
{
39
 
  boost_unique_lock_t scoped_lock(_access);
 
39
  boost::mutex::scoped_lock scoped_lock(_access);
40
40
  cache.erase(identifier.getKey());
41
41
}
42
42
 
43
43
bool Cache::insert(const identifier::Table &identifier, table::shared_ptr share)
44
44
{
45
 
  boost_unique_lock_t scoped_lock(_access);
 
45
  boost::mutex::scoped_lock scoped_lock(_access);
46
46
  return cache.insert(std::make_pair(identifier.getKey(), share)).second;
47
47
}
48
48