~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/cache.cc

  • Committer: Olaf van der Spek
  • Date: 2011-04-13 12:17:56 UTC
  • mto: (2277.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2278.
  • Revision ID: olafvdspek@gmail.com-20110413121756-8zsjfrl52qb28vx1
Thread

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