~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/thr_lock.h

  • Committer: tdavies
  • Date: 2010-10-05 03:25:08 UTC
  • mto: (1816.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1817.
  • Revision ID: tdavies@molly-20101005032508-pd1cg5nmxziov9wv
change in file: ../drizzled/base.h. Converted C structs key_range and KEY_MULTI_RANGE to C++ classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/* For use with thr_locks */
17
17
 
19
19
#define DRIZZLED_THR_LOCK_H
20
20
 
21
21
#include <boost/thread/mutex.hpp>
22
 
#include <boost/thread/shared_mutex.hpp>
23
22
#include <boost/thread/condition_variable.hpp>
 
23
#include <pthread.h>
24
24
 
25
25
namespace drizzled
26
26
{
73
73
 
74
74
struct THR_LOCK_INFO
75
75
{
 
76
  pthread_t thread;
76
77
  uint64_t thread_id;
77
78
  uint32_t n_cursors;
78
79
 
79
80
  THR_LOCK_INFO() : 
 
81
    thread(0),
80
82
    thread_id(0),
81
83
    n_cursors(0)
82
84
  { }
108
110
  THR_LOCK_OWNER *owner;
109
111
  struct THR_LOCK_DATA *next,**prev;
110
112
  struct THR_LOCK *lock;
111
 
  boost::condition_variable_any *cond;
 
113
  boost::condition_variable *cond;
112
114
  enum thr_lock_type type;
113
115
  void *status_param;                   /* Param to status functions */
114
116
 
182
184
  }
183
185
};
184
186
 
185
 
class Session; 
186
187
 
187
188
#define thr_lock_owner_init(owner, info_arg) (owner)->info= (info_arg)
 
189
void thr_lock_info_init(THR_LOCK_INFO *info);
188
190
void thr_lock_init(THR_LOCK *lock);
189
 
enum enum_thr_lock_result thr_multi_lock(Session &session, THR_LOCK_DATA **data,
 
191
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
190
192
                                         uint32_t count, THR_LOCK_OWNER *owner);
191
193
void thr_multi_unlock(THR_LOCK_DATA **data,uint32_t count);
192
194