summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/fops
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2017-06-14 19:39:53 +0000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-06-14 19:39:53 +0000
commit11ca50ae96399aa8b0eaeee5dc115398d78fee2b (patch)
treea54af4da3e0dc8f216c191ce23e650e318ce00ac /src/third_party/wiredtiger/test/fops
parenta16bc9371921766d41e7a86c3ca10080c677ce6d (diff)
downloadmongo-11ca50ae96399aa8b0eaeee5dc115398d78fee2b.tar.gz
Import wiredtiger: 47e8c3d1d22018eaaa09f91dfd78addb49e0b49b from branch mongodb-3.6
ref: 7aaeaaa054..47e8c3d1d2 for: 3.5.9 WT-2596 Document behavior after a crash with a backup cursor open WT-3169 Add ability to log a message when the lookaside file is used WT-3326 workgen: run wtperf "runner" files WT-3332 Add statistic tracking connection wide transaction conflicts WT-3346 workgen: create JSON output for latency sampling WT-3349 Add timing stats to rwlocks WT-3361 Resolve Windows build warnings, build more test programs on Windows. WT-3362 Cursor opens should never block for the duration of a checkpoint WT-3369 WT_CURSOR->uri should always match the URI used to open the cursor
Diffstat (limited to 'src/third_party/wiredtiger/test/fops')
-rw-r--r--src/third_party/wiredtiger/test/fops/fops.c21
-rw-r--r--src/third_party/wiredtiger/test/fops/t.c3
-rw-r--r--src/third_party/wiredtiger/test/fops/thread.h2
3 files changed, 10 insertions, 16 deletions
diff --git a/src/third_party/wiredtiger/test/fops/fops.c b/src/third_party/wiredtiger/test/fops/fops.c
index 571b7dd59fa..911bfba55ad 100644
--- a/src/third_party/wiredtiger/test/fops/fops.c
+++ b/src/third_party/wiredtiger/test/fops/fops.c
@@ -28,7 +28,7 @@
#include "thread.h"
-static void *fop(void *);
+static WT_THREAD_RET fop(void *);
static void print_stats(u_int);
typedef struct {
@@ -46,15 +46,13 @@ typedef struct {
static STATS *run_stats;
-int
+void
fop_start(u_int nthreads)
{
struct timeval start, stop;
double seconds;
- pthread_t *tids;
+ wt_thread_t *tids;
u_int i;
- int ret;
- void *thread_ret;
tids = NULL; /* Silence GCC 4.1 warning. */
@@ -66,13 +64,12 @@ fop_start(u_int nthreads)
/* Create threads. */
for (i = 0; i < nthreads; ++i)
- if ((ret = pthread_create(
- &tids[i], NULL, fop, (void *)(uintptr_t)i)) != 0)
- testutil_die(ret, "pthread_create");
+ testutil_check(__wt_thread_create(
+ NULL, &tids[i], fop, (void *)(uintptr_t)i));
/* Wait for the threads. */
for (i = 0; i < nthreads; ++i)
- (void)pthread_join(tids[i], &thread_ret);
+ testutil_check(__wt_thread_join(NULL, tids[i]));
(void)gettimeofday(&stop, NULL);
seconds = (stop.tv_sec - start.tv_sec) +
@@ -84,15 +81,13 @@ fop_start(u_int nthreads)
free(run_stats);
free(tids);
-
- return (0);
}
/*
* fop --
* File operation function.
*/
-static void *
+static WT_THREAD_RET
fop(void *arg)
{
STATS *s;
@@ -150,7 +145,7 @@ fop(void *arg)
break;
}
- return (NULL);
+ return (WT_THREAD_RET_VALUE);
}
/*
diff --git a/src/third_party/wiredtiger/test/fops/t.c b/src/third_party/wiredtiger/test/fops/t.c
index a481c9ff1c4..2357b170e49 100644
--- a/src/third_party/wiredtiger/test/fops/t.c
+++ b/src/third_party/wiredtiger/test/fops/t.c
@@ -129,8 +129,7 @@ main(int argc, char *argv[])
wt_startup(config_open);
- if (fop_start(nthreads))
- return (EXIT_FAILURE);
+ fop_start(nthreads);
wt_shutdown();
printf("\n");
diff --git a/src/third_party/wiredtiger/test/fops/thread.h b/src/third_party/wiredtiger/test/fops/thread.h
index 9c1fb0150a6..f6b6bdffd63 100644
--- a/src/third_party/wiredtiger/test/fops/thread.h
+++ b/src/third_party/wiredtiger/test/fops/thread.h
@@ -39,7 +39,7 @@ extern const char *config; /* Object config */
extern pthread_rwlock_t single; /* Single-thread */
-int fop_start(u_int);
+void fop_start(u_int);
void obj_bulk(void);
void obj_bulk_unique(int);
void obj_checkpoint(void);