~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/current_session.cc

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

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