~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/thread_var.h

  • Committer: Brian Aker
  • Date: 2010-09-21 09:57:03 UTC
  • Revision ID: brian@tangent.org-20100921095703-622iopd89890rsky
This modifies our thread system to be based on boost, and it fixes a
critical bug where stack size was not being calculated correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
namespace internal
29
29
{
30
30
 
 
31
static pthread_t wrapper_pthread_self()
 
32
{
 
33
  return pthread_self();
 
34
}
 
35
 
31
36
struct st_my_thread_var
32
37
{
33
38
  pthread_cond_t suspend;
37
42
  pthread_t pthread_self;
38
43
  uint64_t id;
39
44
  int volatile abort;
40
 
  bool init;
41
45
  struct st_my_thread_var *next,**prev;
42
46
  void *opt_info;
 
47
 
 
48
  st_my_thread_var() :
 
49
    current_mutex(0),
 
50
    current_cond(0),
 
51
    id(0),
 
52
    abort(false),
 
53
    next(0),
 
54
    prev(0),
 
55
    opt_info(0)
 
56
  { 
 
57
    pthread_self= wrapper_pthread_self();
 
58
    pthread_mutex_init(&mutex, NULL);
 
59
    pthread_cond_init(&suspend, NULL);
 
60
  }
 
61
 
 
62
  ~st_my_thread_var()
 
63
  {
 
64
    pthread_cond_destroy(&suspend);
 
65
    pthread_mutex_destroy(&mutex);
 
66
  }
43
67
};
44
68
 
45
69
extern struct st_my_thread_var *_my_thread_var(void);