~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/thread_var.h

Merge Monty - Added inter-plugin dependencies for controlling plugin load order

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/* Defines to make different thread packages compatible */
17
17
 
18
 
#pragma once
 
18
#ifndef DRIZZLED_INTERNAL_THREAD_VAR_H
 
19
#define DRIZZLED_INTERNAL_THREAD_VAR_H
19
20
 
20
21
#include <pthread.h>
21
22
#include <boost/thread/recursive_mutex.hpp>
23
24
#include <boost/thread/shared_mutex.hpp>
24
25
#include <boost/thread/condition_variable.hpp>
25
26
 
26
 
namespace drizzled {
27
 
namespace internal {
 
27
namespace drizzled
 
28
{
 
29
namespace internal
 
30
{
28
31
 
29
32
struct st_my_thread_var
30
33
{
31
34
  boost::condition_variable_any suspend;
32
35
  boost::mutex mutex;
33
 
  boost::mutex* volatile current_mutex;
34
 
  boost::condition_variable_any* volatile current_cond;
 
36
  boost::mutex * volatile current_mutex;
 
37
  boost::condition_variable_any * volatile current_cond;
35
38
  uint64_t id;
36
 
  bool volatile abort;
37
 
  void* opt_info;
 
39
  int volatile abort;
 
40
  void *opt_info;
38
41
 
39
 
  st_my_thread_var(uint64_t id0) :
40
 
    current_mutex(NULL),
41
 
    current_cond(NULL),
42
 
    id(id0),
 
42
  st_my_thread_var() :
 
43
    current_mutex(0),
 
44
    current_cond(0),
 
45
    id(0),
43
46
    abort(false),
44
 
    opt_info(NULL)
 
47
    opt_info(0)
45
48
  { 
46
49
  }
 
50
 
 
51
  ~st_my_thread_var()
 
52
  {
 
53
  }
47
54
};
48
55
 
49
 
extern struct st_my_thread_var* _my_thread_var();
 
56
extern struct st_my_thread_var *_my_thread_var(void);
50
57
#define my_thread_var (::drizzled::internal::_my_thread_var())
51
58
 
52
59
} /* namespace internal */
53
60
} /* namespace drizzled */
54
61
 
 
62
#endif /* DRIZZLED_INTERNAL_THREAD_VAR_H */