~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/thread_var.h

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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