summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/os_posix
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2017-11-13 09:31:33 +1100
committerLuke Chen <luke.chen@mongodb.com>2017-11-13 09:31:33 +1100
commit6554a50f2810b9e233f8cb6077d831e43ff2f8aa (patch)
tree29dcbe7164e0236caa56b342868f97b24320aa13 /src/third_party/wiredtiger/src/os_posix
parent13f29c918109df1dbbc3b561beb422650b8f3873 (diff)
downloadmongo-6554a50f2810b9e233f8cb6077d831e43ff2f8aa.tar.gz
Import wiredtiger: 3a8316e86e9c7cd379679d8530ecc54ad9bdf5c1 from branch mongodb-3.6
ref: 0a2f8f6ad7..3a8316e86e for: 3.6.0-rc4 WT-3637 Fix a heap use after free from evicting of a page that just split. WT-3648 Fix timestamp_abort test calculation of the oldest timestamp WT-3696 Add diagnostic code to detect when sessions are in use by multiple threads WT-3710 Fix a race condition between concurrent page splits WT-3715 Performance tuning for cache overflow mechanism WT-3717 Add a diagnostic verbose lookaside mode WT-3730 For simple tables, do not use table dhandle after it is released
Diffstat (limited to 'src/third_party/wiredtiger/src/os_posix')
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_map.c2
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_thread.c24
2 files changed, 24 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/os_posix/os_map.c b/src/third_party/wiredtiger/src/os_posix/os_map.c
index 3d06461a9ba..5e625a49bac 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_map.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_map.c
@@ -88,7 +88,7 @@ __wt_posix_map_preload(WT_FILE_HANDLE *fh,
length += WT_PTRDIFF(map, blk);
/* XXX proxy for "am I doing a scan?" -- manual read-ahead */
- if (F_ISSET(session, WT_SESSION_NO_CACHE)) {
+ if (F_ISSET(session, WT_SESSION_READ_WONT_NEED)) {
/* Read in 2MB blocks every 1MB of data. */
if (((uintptr_t)((uint8_t *)blk + length) &
(uintptr_t)((1<<20) - 1)) < (uintptr_t)blk)
diff --git a/src/third_party/wiredtiger/src/os_posix/os_thread.c b/src/third_party/wiredtiger/src/os_posix/os_thread.c
index 8af672dd0d4..dc4d49ad493 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_thread.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_thread.c
@@ -67,10 +67,32 @@ __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid)
/*
* __wt_thread_id --
+ * Return an arithmetic representation of a thread ID on POSIX.
+ */
+void
+__wt_thread_id(uintmax_t *id)
+ WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
+{
+ pthread_t self;
+
+ /*
+ * POSIX 1003.1 allows pthread_t to be an opaque type; on systems where
+ * it's a pointer, print the pointer to match gdb output.
+ */
+ self = pthread_self();
+#ifdef __sun
+ *id = (uintmax_t)self;
+#else
+ *id = (uintmax_t)(void *)self;
+#endif
+}
+
+/*
+ * __wt_thread_str --
* Fill in a printable version of the process and thread IDs.
*/
int
-__wt_thread_id(char *buf, size_t buflen)
+__wt_thread_str(char *buf, size_t buflen)
WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
pthread_t self;