~kalebral-deactivatedaccount/drizzle/621304

« back to all changes in this revision

Viewing changes to drizzled/thr_lock.h

  • Committer: lbieber
  • Date: 2010-09-24 17:14:34 UTC
  • mfrom: (1791.2.1 build)
  • Revision ID: lbieber@orisndriz08-20100924171434-yejt9e2n459hafpa
Merge Brian - Latest work on boost, also PBXT set to be linux only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#ifndef DRIZZLED_THR_LOCK_H
19
19
#define DRIZZLED_THR_LOCK_H
20
20
 
 
21
#include <boost/thread/mutex.hpp>
 
22
#include <boost/thread/condition_variable.hpp>
21
23
#include <pthread.h>
22
24
 
23
25
namespace drizzled
108
110
  THR_LOCK_OWNER *owner;
109
111
  struct THR_LOCK_DATA *next,**prev;
110
112
  struct THR_LOCK *lock;
111
 
  pthread_cond_t *cond;
 
113
  boost::condition_variable *cond;
112
114
  enum thr_lock_type type;
113
115
  void *status_param;                   /* Param to status functions */
114
116
 
137
139
 
138
140
struct THR_LOCK {
139
141
private:
140
 
  pthread_mutex_t mutex;
 
142
  boost::mutex mutex;
141
143
public:
142
144
  struct st_lock_list read_wait;
143
145
  struct st_lock_list read;
160
162
 
161
163
  void lock()
162
164
  {
163
 
    pthread_mutex_lock(&mutex);
 
165
    mutex.lock();
164
166
  }
165
167
 
166
168
  void unlock()
167
169
  {
168
 
    pthread_mutex_unlock(&mutex);
 
170
    mutex.unlock();
169
171
  }
170
172
 
171
173
  void init()
172
174
  {
173
 
    pthread_mutex_init(&mutex, NULL);
174
175
  }
175
176
 
176
177
  void deinit()
177
178
  {
178
 
    pthread_mutex_destroy(&mutex);
179
179
  }
180
180
 
181
 
  pthread_mutex_t *native_handle()
 
181
  boost::mutex *native_handle()
182
182
  {
183
183
    return &mutex;
184
184
  }