~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/query_id.h

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

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_QUERY_ID_H
21
 
#define DRIZZLED_QUERY_ID_H
 
20
#ifndef DRIZZLED_GLOBAL_QUERY_ID_H
 
21
#define DRIZZLED_GLOBAL_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;
30
24
 
31
25
class Query_id
32
26
{
44
38
  query_id_t next();
45
39
 
46
40
private:
47
 
  atomic<uint64_t> the_query_id;
 
41
  pthread_mutex_t LOCK_query_id;
 
42
  query_id_t the_query_id;
48
43
 
49
44
  Query_id();
50
45
  Query_id(Query_id const&);
51
46
  Query_id& operator=(Query_id const&);
52
47
};
53
48
 
54
 
} /* namespace drizzled */
55
 
 
56
 
#endif /* DRIZZLED_QUERY_ID_H */
 
49
#endif