summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorDmitri Smirnov <dmitrism@microsoft.com>2016-02-19 12:29:54 -0800
committerDmitri Smirnov <dmitrism@microsoft.com>2016-02-19 12:29:54 -0800
commitd37d348da87ea0e87edf158edfa62fd20a325ad3 (patch)
treeee162c107c7bb4c0b93ef3e53e4ac902ba2615ee /util
parentd825fc70d4995527a8daebc64c51515baf2670ad (diff)
This addresses build issues on Windows
https://github.com/facebook/rocksdb/issues/1002
Diffstat (limited to 'util')
-rw-r--r--util/thread_local_test.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/util/thread_local_test.cc b/util/thread_local_test.cc
index f531dfd0c..3fc5bc288 100644
--- a/util/thread_local_test.cc
+++ b/util/thread_local_test.cc
@@ -3,7 +3,7 @@
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
-#include <pthread.h>
+#include <thread>
#include <atomic>
#include <string>
@@ -496,9 +496,15 @@ TEST_F(ThreadLocalTest, DISABLED_MainThreadDiesFirst) {
// Triggers the initialization of singletons.
Env::Default();
- pthread_t t;
- pthread_create(&t, nullptr, &AccessThreadLocal, nullptr);
- TEST_SYNC_POINT("MainThreadDiesFirst:End");
+
+ try {
+ std::thread th(&AccessThreadLocal, nullptr);
+ th.detach();
+ TEST_SYNC_POINT("MainThreadDiesFirst:End");
+ } catch (const std::system_error& ex) {
+ std::cerr << "Start thread: " << ex.code() << std::endl;
+ ASSERT_TRUE(false);
+ }
}
} // namespace rocksdb