~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session_list.cc

  • Committer: David Shrewsbury
  • Date: 2010-11-19 15:23:07 UTC
  • mto: (1942.1.3 b)
  • mto: This revision was merged to the branch mainline in revision 1943.
  • Revision ID: shrewsbury.dave@gmail.com-20101119152307-srnssq2n5num5tit
Add --replicate-query option.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <vector>
23
23
 
24
 
#include "drizzled/session/cache.h"
 
24
#include "drizzled/session_list.h"
25
25
#include "drizzled/session.h"
26
26
#include "drizzled/current_session.h"
27
27
#include "drizzled/plugin/authorization.h"
28
28
 
29
 
#include <boost/foreach.hpp>
 
29
using namespace std;
30
30
 
31
31
namespace drizzled
32
32
{
37
37
Session::shared_ptr Cache::find(const session_id_t &id)
38
38
{
39
39
  boost::mutex::scoped_lock scopedLock(_mutex);
40
 
 
41
 
  BOOST_FOREACH(list::const_reference it, cache)
 
40
  for (List::iterator it= cache.begin(); it != cache.end(); ++it )
42
41
  {
43
 
    if (it->thread_id == id)
 
42
    if ((*it)->thread_id == id)
44
43
    {
45
 
      return it;
 
44
      return *it;
46
45
    }
47
46
  }
48
47
 
58
57
 
59
58
void Cache::erase(Session::Ptr arg)
60
59
{
61
 
  BOOST_FOREACH(list::const_reference it, cache)
 
60
  for (List::iterator it= cache.begin(); it != cache.end(); it++)
62
61
  {
63
 
    if (it.get() == arg)
 
62
    if ((*it).get() == arg)
64
63
    {
65
 
      cache.remove(it);
 
64
      cache.erase(it);
66
65
      return;
67
66
    }
68
67
  }