~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/current_session.cc

  • Committer: Joe Daly
  • Date: 2010-01-06 02:20:42 UTC
  • mto: This revision was merged to the branch mainline in revision 1267.
  • Revision ID: skinny.moey@gmail.com-20100106022042-8ov23wc4aq8f9k7d
rename hash_algorithm to algorithm

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "config.h"
21
21
#include <drizzled/current_session.h>
22
22
 
23
 
namespace drizzled
24
 
{
25
 
 
26
 
static MySessionVar THR_Session;
27
 
static MyMemoryRootVar THR_Mem_root;
28
 
 
29
 
MySessionVar &currentSession(void)
30
 
{
31
 
  return THR_Session;
32
 
}
33
 
 
34
 
MyMemoryRootVar &currentMemRoot(void)
35
 
{
36
 
  return THR_Mem_root;
37
 
}
 
23
#include <pthread.h>
 
24
 
 
25
using namespace drizzled;
 
26
 
 
27
extern pthread_key_t THR_Session;
 
28
extern pthread_key_t THR_Mem_root;
38
29
 
39
30
Session *_current_session(void)
40
31
{
41
 
  return THR_Session.get();
 
32
  return static_cast<Session *>(pthread_getspecific(THR_Session));
42
33
}
43
34
 
 
35
 
44
36
memory::Root *current_mem_root(void)
45
37
{
46
 
  return *(currentMemRoot().get());
 
38
  return *(static_cast<memory::Root **>(pthread_getspecific(THR_Mem_root)));
47
39
}
48
 
 
49
 
} /* namespace drizzled */