~atcurtis/drizzle/experimental1

« back to all changes in this revision

Viewing changes to storage/archive/concurrency_test.c

  • Committer: Antony Curtis
  • Date: 2008-07-30 20:09:32 UTC
  • mfrom: (134.1.105 drizzle)
  • Revision ID: atcurtis@dhcp-172-29-58-124.smo.corp.google.com-20080730200932-t6sop64d2jryozy3
merge from main development

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
  Just a test application for threads.
3
3
  */
4
4
#include "azio.h"
5
 
#include <drizzle.h>
6
 
#include <my_getopt.h>
7
 
#include <drizzle_version.h>
 
5
#include <libdrizzle/drizzle.h>
 
6
#include <mysys/my_getopt.h>
8
7
#include <stdio.h>
9
8
#include <stdlib.h>
10
9
#include <sys/types.h>
14
13
#include <fcntl.h>
15
14
#include <sys/time.h>
16
15
#include <pthread.h>
17
 
#include <strings.h>
 
16
#include <string.h>                             /* Pull in memset() */
18
17
#ifndef __WIN__
19
18
#include <sys/wait.h>
20
19
#endif
138
137
  pthread_mutex_unlock(&sleeper_mutex);
139
138
 
140
139
  context= (thread_context_st *)malloc(sizeof(thread_context_st) * DEFAULT_CONCURRENCY);
141
 
  bzero(context, sizeof(thread_context_st) * DEFAULT_CONCURRENCY);
 
140
  memset(context, 0, sizeof(thread_context_st) * DEFAULT_CONCURRENCY);
142
141
 
143
142
  if (!context)
144
143
  {
195
194
  {
196
195
    struct timespec abstime;
197
196
 
198
 
    bzero(&abstime, sizeof(struct timespec));
 
197
    memset(&abstime, 0, sizeof(struct timespec));
199
198
    abstime.tv_sec= 1;
200
199
 
201
200
    pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);