Commit 8b0b2bba authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

Roll src/third_party/leveldatabase/src/ 7b945f200..73d5834ec (3 commits)

https://chromium.googlesource.com/external/leveldb.git/+log/7b945f200339..73d5834eceee

This CL also removes port_chromium's InitOnce implementation, because it
is no longer used by leveldb.

$ git log 7b945f200..73d5834ec --date=short --no-merges --format='%ad %ae %s'
2018-09-11 costan Rework threading in env_posix.cc.
2018-09-10 costan Remove InitOnce from the port API.
2018-09-05 costan Clean up PosixWritableFile in env_posix.cc.

Created with:
  roll-dep src/third_party/leveldatabase/src

Change-Id: Icba857ff32949a1b6f4cd385330a01c7ac02798d
Reviewed-on: https://chromium-review.googlesource.com/c/1220056Reviewed-by: default avatarChris Mumford <cmumford@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596422}
parent 2eafcaba
......@@ -804,7 +804,7 @@ deps = {
},
'src/third_party/leveldatabase/src':
Var('chromium_git') + '/external/leveldb.git' + '@' + '7b945f200339aa47c24788d3ee9910c09c513843',
Var('chromium_git') + '/external/leveldb.git' + '@' + '73d5834eceee8efa9a8ccfec77dc096a9e8ba18a',
'src/third_party/libFuzzer/src':
Var('chromium_git') + '/chromium/llvm-project/compiler-rt/lib/fuzzer.git' + '@' + Var('libfuzzer_revision'),
......
......@@ -48,27 +48,6 @@ void CondVar::SignalAll() {
cv_.Broadcast();
}
void InitOnceImpl(OnceType* once, void (*initializer)()) {
OnceType state = base::subtle::Acquire_Load(once);
if (state == ONCE_STATE_DONE)
return;
state = base::subtle::NoBarrier_CompareAndSwap(once, ONCE_STATE_UNINITIALIZED,
ONCE_STATE_EXECUTING_CLOSURE);
if (state == ONCE_STATE_UNINITIALIZED) {
// We are the first thread, we have to call the closure.
(*initializer)();
base::subtle::Release_Store(once, ONCE_STATE_DONE);
} else {
// Another thread is running the closure, wait until completion.
while (state == ONCE_STATE_EXECUTING_CLOSURE) {
base::PlatformThread::YieldCurrentThread();
state = base::subtle::Acquire_Load(once);
}
}
}
bool Snappy_Compress(const char* input,
size_t input_length,
std::string* output) {
......
......@@ -85,26 +85,6 @@ class AtomicPointer {
Rep rep_;
};
// Implementation of OnceType and InitOnce() pair, this is equivalent to
// pthread_once_t and pthread_once().
typedef base::subtle::Atomic32 OnceType;
enum {
ONCE_STATE_UNINITIALIZED = 0,
ONCE_STATE_EXECUTING_CLOSURE = 1,
ONCE_STATE_DONE = 2
};
#define LEVELDB_ONCE_INIT leveldb::port::ONCE_STATE_UNINITIALIZED
// slow code path
void InitOnceImpl(OnceType* once, void (*initializer)());
static inline void InitOnce(OnceType* once, void (*initializer)()) {
if (base::subtle::Acquire_Load(once) != ONCE_STATE_DONE)
InitOnceImpl(once, initializer);
}
bool Snappy_Compress(const char* input, size_t input_length,
std::string* output);
bool Snappy_GetUncompressedLength(const char* input, size_t length,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment