~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/current_session.cc

  • Committer: Brian Aker
  • Date: 2010-09-12 01:42:27 UTC
  • mto: (1759.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 1762.
  • Revision ID: brian@tangent.org-20100912014227-krt6d9z5ohqrokhb
Add two plugins to handle the string and math functions.

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
#include <pthread.h>
 
24
 
23
25
namespace drizzled
24
26
{
25
27
 
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
 
}
 
28
extern pthread_key_t THR_Session;
 
29
extern pthread_key_t THR_Mem_root;
38
30
 
39
31
Session *_current_session(void)
40
32
{
41
 
  return THR_Session.get();
 
33
  return static_cast<Session *>(pthread_getspecific(THR_Session));
42
34
}
43
35
 
 
36
 
44
37
memory::Root *current_mem_root(void)
45
38
{
46
 
  return *(currentMemRoot().get());
 
39
  return *(static_cast<memory::Root **>(pthread_getspecific(THR_Mem_root)));
47
40
}
48
41
 
49
42
} /* namespace drizzled */