~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/thr_lock.h

  • Committer: Olaf van der Spek
  • Date: 2011-10-24 21:23:54 UTC
  • mto: This revision was merged to the branch mainline in revision 2449.
  • Revision ID: olafvdspek@gmail.com-20111024212354-j32gbc2sbsw0985q
Use str_ref

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/* For use with thr_locks */
17
17
 
18
 
#ifndef DRIZZLED_THR_LOCK_H
19
 
#define DRIZZLED_THR_LOCK_H
 
18
#pragma once
20
19
 
21
20
#include <boost/thread/mutex.hpp>
22
21
#include <boost/thread/shared_mutex.hpp>
23
22
#include <boost/thread/condition_variable.hpp>
24
23
 
25
 
namespace drizzled
26
 
{
 
24
#include <drizzled/visibility.h>
 
25
 
 
26
namespace drizzled {
27
27
 
28
28
extern uint64_t max_write_lock_count;
29
29
extern uint64_t table_lock_wait_timeout;
104
104
struct THR_LOCK;
105
105
struct THR_LOCK_DATA;
106
106
 
107
 
struct THR_LOCK_DATA {
 
107
struct DRIZZLED_API THR_LOCK_DATA {
108
108
  THR_LOCK_OWNER *owner;
109
109
  struct THR_LOCK_DATA *next,**prev;
110
110
  struct THR_LOCK *lock;
152
152
    read_no_write_count(0)
153
153
  { }
154
154
 
155
 
  ~THR_LOCK()
156
 
  { }
157
 
 
158
155
  void abort_locks();
159
156
  bool abort_locks_for_thread(uint64_t thread);
160
157
 
168
165
    mutex.unlock();
169
166
  }
170
167
 
171
 
  void init()
172
 
  {
173
 
  }
174
 
 
175
 
  void deinit()
176
 
  {
177
 
  }
178
 
 
179
168
  boost::mutex *native_handle()
180
169
  {
181
170
    return &mutex;
182
171
  }
183
172
};
184
173
 
185
 
class Session; 
186
 
 
187
174
#define thr_lock_owner_init(owner, info_arg) (owner)->info= (info_arg)
188
 
void thr_lock_init(THR_LOCK *lock);
 
175
DRIZZLED_API void thr_lock_init(THR_LOCK *lock);
189
176
enum enum_thr_lock_result thr_multi_lock(Session &session, THR_LOCK_DATA **data,
190
177
                                         uint32_t count, THR_LOCK_OWNER *owner);
191
178
void thr_multi_unlock(THR_LOCK_DATA **data,uint32_t count);
192
179
 
193
180
} /* namespace drizzled */
194
181
 
195
 
#endif /* DRIZZLED_THR_LOCK_H */