~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session/cache.cc

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <vector>
23
 
 
24
 
#include <drizzled/session.h>
 
20
#include <config.h>
25
21
#include <drizzled/session/cache.h>
26
 
#include <drizzled/current_session.h>
27
 
#include <drizzled/plugin/authorization.h>
28
 
 
29
 
#include <boost/foreach.hpp>
30
 
 
31
 
namespace drizzled
32
 
{
33
 
 
34
 
namespace session
35
 
{
 
22
 
 
23
#include <boost/foreach.hpp>
 
24
#include <drizzled/current_session.h>
 
25
#include <drizzled/plugin/authorization.h>
 
26
#include <drizzled/session.h>
 
27
#include <vector>
 
28
 
 
29
namespace drizzled {
 
30
namespace session {
 
31
 
 
32
bool volatile Cache::_ready_to_exit= false;
 
33
Cache::list Cache::cache;
 
34
boost::mutex Cache::_mutex;
 
35
boost::condition_variable Cache::_end;
36
36
 
37
37
Cache::session_shared_ptr Cache::find(const session_id_t &id)
38
38
{
39
39
  boost::mutex::scoped_lock scopedLock(_mutex);
40
 
 
41
40
  BOOST_FOREACH(list::const_reference it, cache)
42
41
  {
43
42
    if (it->thread_id == id)
44
 
    {
45
43
      return it;
46
 
    }
47
44
  }
48
 
 
49
45
  return session_shared_ptr();
50
46
}
51
47