Merge pull request #1003 from yuslepukhin/fix_mutexlock_pthread_build
This addresses build issues on Windows
This commit is contained in:
commit
0914f0ca55
@ -14,6 +14,7 @@
|
|||||||
#include "port/port.h"
|
#include "port/port.h"
|
||||||
#include "port/util_logger.h"
|
#include "port/util_logger.h"
|
||||||
#include "util/sync_point.h"
|
#include "util/sync_point.h"
|
||||||
|
#include "util/mutexlock.h"
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// LICENSE file in the root directory of this source tree. An additional grant
|
// 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.
|
// of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -496,9 +496,15 @@ TEST_F(ThreadLocalTest, DISABLED_MainThreadDiesFirst) {
|
|||||||
|
|
||||||
// Triggers the initialization of singletons.
|
// Triggers the initialization of singletons.
|
||||||
Env::Default();
|
Env::Default();
|
||||||
pthread_t t;
|
|
||||||
pthread_create(&t, nullptr, &AccessThreadLocal, nullptr);
|
try {
|
||||||
TEST_SYNC_POINT("MainThreadDiesFirst:End");
|
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
|
} // namespace rocksdb
|
||||||
|
Loading…
Reference in New Issue
Block a user