diff options
author | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-06-14 19:39:53 +0000 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2017-06-14 19:39:53 +0000 |
commit | 11ca50ae96399aa8b0eaeee5dc115398d78fee2b (patch) | |
tree | a54af4da3e0dc8f216c191ce23e650e318ce00ac /src/third_party/wiredtiger/examples/c/ex_thread.c | |
parent | a16bc9371921766d41e7a86c3ca10080c677ce6d (diff) | |
download | mongo-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/examples/c/ex_thread.c')
-rw-r--r-- | src/third_party/wiredtiger/examples/c/ex_thread.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/third_party/wiredtiger/examples/c/ex_thread.c b/src/third_party/wiredtiger/examples/c/ex_thread.c index b69b3e9e7e9..ad2ff7f68a0 100644 --- a/src/third_party/wiredtiger/examples/c/ex_thread.c +++ b/src/third_party/wiredtiger/examples/c/ex_thread.c @@ -34,22 +34,14 @@ #include <stdlib.h> #include <string.h> -#ifndef _WIN32 -#include <pthread.h> -#else -#include "windows_shim.h" -#endif - -#include <wiredtiger.h> +#include "wt_internal.h" static const char *home; -void *scan_thread(void *arg); - #define NUM_THREADS 10 /*! [thread scan] */ -void * +static WT_THREAD_RET scan_thread(void *conn_arg) { WT_CONNECTION *conn; @@ -74,7 +66,7 @@ scan_thread(void *conn_arg) fprintf(stderr, "WT_CURSOR.next: %s\n", session->strerror(session, ret)); - return (NULL); + return (WT_THREAD_RET_VALUE); } /*! [thread scan] */ @@ -85,7 +77,7 @@ main(void) WT_CONNECTION *conn; WT_SESSION *session; WT_CURSOR *cursor; - pthread_t threads[NUM_THREADS]; + wt_thread_t threads[NUM_THREADS]; int i, ret; /* @@ -114,10 +106,10 @@ main(void) ret = session->close(session, NULL); for (i = 0; i < NUM_THREADS; i++) - ret = pthread_create(&threads[i], NULL, scan_thread, conn); + ret = __wt_thread_create(NULL, &threads[i], scan_thread, conn); for (i = 0; i < NUM_THREADS; i++) - ret = pthread_join(threads[i], NULL); + ret = __wt_thread_join(NULL, threads[i]); ret = conn->close(conn, NULL); |