~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/archive/concurrency_test.c

  • Committer: Monty Taylor
  • Date: 2008-09-14 00:14:42 UTC
  • mto: This revision was merged to the branch mainline in revision 387.
  • Revision ID: monty@inaugust.com-20080914001442-09k3yuht4gopk0t6
Reworked drizzle_escape_string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
  if (argc > 1)
88
88
    exit(1);
89
89
 
90
 
  if (!(drizzle_thread_safe()))
91
 
      fprintf(stderr, "This application was compiled incorrectly. Please recompile with thread support.\n");
92
 
 
93
90
  srandom(time(NULL));
94
91
 
95
92
  pthread_mutex_init(&counter_mutex, NULL);
215
212
  time_t *timer_length= (time_t *)p;
216
213
  struct timespec abstime;
217
214
 
218
 
  if (drizzle_thread_init())
219
 
  {
220
 
    fprintf(stderr,"%s: drizzle_thread_init() failed.\n",
221
 
            my_progname);
222
 
    exit(1);
223
 
  }
224
 
 
225
215
  /* 
226
216
    We lock around the initial call in case were we in a loop. This 
227
217
    also keeps the value properly syncronized across call threads.
243
233
  timer_alarm= false;
244
234
  pthread_mutex_unlock(&timer_alarm_mutex);
245
235
 
246
 
  drizzle_thread_end();
247
 
 
248
236
  return 0;
249
237
}
250
238
 
256
244
  int error;
257
245
  azio_stream reader_handle;
258
246
 
259
 
  if (drizzle_thread_init())
260
 
  {
261
 
    fprintf(stderr,"%s: drizzle_thread_init() failed.\n", my_progname);
262
 
    exit(1);
263
 
  }
264
 
 
265
247
  if (!(ret= azopen(&reader_handle, TEST_FILENAME, O_RDONLY|O_BINARY,
266
248
                    context->use_aio)))
267
249
  {
300
282
  pthread_mutex_unlock(&counter_mutex);
301
283
  azclose(&reader_handle);
302
284
 
303
 
  drizzle_thread_end();
304
 
 
305
285
  return NULL;
306
286
}
307
287