~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/concurrency_test.cc

  • Committer: Stewart Smith
  • Date: 2010-04-07 02:08:20 UTC
  • mto: (1283.38.1)
  • mto: This revision was merged to the branch mainline in revision 1536.
  • Revision ID: stewart@flamingspork.com-20100407020820-4elzp2uuorw5vv89
add basic_create_select test that currently causes a crash due to https://bugs.launchpad.net/drizzle/+bug/556978

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
21
21
  Just a test application for threads.
22
22
  */
23
23
 
24
 
#include <config.h>
 
24
#include "config.h"
25
25
 
26
26
#include "azio.h"
 
27
#include "drizzled/option.h"
27
28
#include <stdio.h>
28
29
#include <stdlib.h>
29
30
#include <sys/types.h>
37
38
#ifndef __WIN__
38
39
#include <sys/wait.h>
39
40
#endif
40
 
#include <memory>
41
41
 
42
42
#ifdef __WIN__
43
43
#define srandom  srand
45
45
#define snprintf _snprintf
46
46
#endif
47
47
 
48
 
#include <boost/scoped_ptr.hpp>
49
 
 
50
48
#include "azio.h"
51
49
 
52
 
#define DEFAULT_CONCURRENCY     10
53
50
#define DEFAULT_INITIAL_LOAD 10000
54
51
#define DEFAULT_EXECUTE_SECONDS 120
55
52
#define TEST_FILENAME "concurrency_test.az"
140
137
{
141
138
  unsigned int x;
142
139
  uint64_t total;
143
 
  boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
144
 
  azio_stream &writer_handle= *writer_handle_ap.get();
 
140
  azio_stream writer_handle;
145
141
  thread_context_st *context;
146
142
  pthread_t mainthread;            /* Thread descriptor */
147
143
  pthread_attr_t attr;          /* Thread attributes */
268
264
  uint64_t count;
269
265
  int ret;
270
266
  int error;
271
 
  boost::scoped_ptr<azio_stream> reader_handle_ap(new azio_stream);
272
 
  azio_stream &reader_handle= *reader_handle_ap.get();
 
267
  azio_stream reader_handle;
273
268
 
274
269
  if (!(ret= azopen(&reader_handle, TEST_FILENAME, O_RDONLY,
275
270
                    context->use_aio)))