~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/archive/concurrency_test.c

  • Committer: Jay Pipes
  • Date: 2009-02-21 16:00:06 UTC
  • mto: (907.1.1 trunk-with-temporal)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090221160006-vnk3wt4qbcz62eru
Removes the TIME column type and related time functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
19
 
 
20
1
/*
21
2
  Just a test application for threads.
22
3
  */
23
 
 
24
 
#include "config.h"
25
 
 
26
4
#include "azio.h"
27
 
#include "drizzled/option.h"
 
5
#include <libdrizzleclient/libdrizzle.h>
 
6
#include <mysys/my_getopt.h>
28
7
#include <stdio.h>
29
8
#include <stdlib.h>
30
9
#include <sys/types.h>
67
46
pthread_mutex_t row_lock;
68
47
 
69
48
/* Prototypes */
70
 
extern "C" {
71
 
  void *run_concurrent_task(void *p);
72
 
  void *timer_thread(void *p);
73
 
}
 
49
void *run_concurrent_task(void *p);
 
50
void *timer_thread(void *p);
74
51
void scheduler(az_method use_aio);
75
52
void create_data_file(azio_stream *write_handler, uint64_t rows);
76
53
unsigned int write_row(azio_stream *s);
101
78
int main(int argc, char *argv[])
102
79
{
103
80
 
104
 
  unsigned int method;
105
 
  drizzled::internal::my_init();
 
81
  az_method method;
 
82
  my_init();
106
83
 
107
84
  MY_INIT(argv[0]);
108
85
 
120
97
  pthread_mutex_init(&row_lock, NULL);
121
98
 
122
99
  for (method= AZ_METHOD_BLOCK; method < AZ_METHOD_MAX; method++)
123
 
    scheduler((az_method)method);
 
100
    scheduler(method);
124
101
 
125
102
  (void)pthread_mutex_destroy(&counter_mutex);
126
103
  (void)pthread_cond_destroy(&count_threshhold);
192
169
    if (pthread_create(&mainthread, &attr, timer_thread,
193
170
                       (void *)&opt_timer_length) != 0)
194
171
    {
195
 
      fprintf(stderr,"%s: Could not create timer thread\n", drizzled::internal::my_progname);
 
172
      fprintf(stderr,"%s: Could not create timer thread\n", my_progname);
196
173
      exit(1);
197
174
    }
198
175
  }