~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/query_id.h

Merge Revision revid:marko.makela@oracle.com-20100505101406-u4low2x26q6itck0 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100505101406-u4low2x26q6itck0

Original Authors: Marko Mäkelä <marko.makela@oracle.com>
Original commit message:
Merge from mysql-5.1-innodb:

  ------------------------------------------------------------
  revno: 3446
  revision-id: marko.makela@oracle.com-20100505100507-6kcd2hf32hruxbv7
  parent: marko.makela@oracle.com-20100505095328-vetnl0flhmhao7p5
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Wed 2010-05-05 13:05:07 +0300
  message:
    Add Valgrind diagnostics to track down Bug #38999.
  ------------------------------------------------------------

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_GLOBAL_QUERY_ID_H
21
 
#define DRIZZLED_GLOBAL_QUERY_ID_H
 
20
#ifndef DRIZZLED_QUERY_ID_H
 
21
#define DRIZZLED_QUERY_ID_H
22
22
 
23
23
#include <pthread.h>
 
24
#include <drizzled/atomics.h>
 
25
 
 
26
namespace drizzled
 
27
{
 
28
 
 
29
typedef uint64_t query_id_t;
24
30
 
25
31
class Query_id
26
32
{
38
44
  query_id_t next();
39
45
 
40
46
private:
41
 
  pthread_mutex_t LOCK_query_id;
42
 
  query_id_t the_query_id;
 
47
  atomic<uint64_t> the_query_id;
43
48
 
44
49
  Query_id();
45
50
  Query_id(Query_id const&);
46
51
  Query_id& operator=(Query_id const&);
47
52
};
48
53
 
49
 
#endif
 
54
} /* namespace drizzled */
 
55
 
 
56
#endif /* DRIZZLED_QUERY_ID_H */