MCPcopy Create free account
hub / github.com/ElementsProject/elements / BackgroundThreadMain

Method BackgroundThreadMain

src/leveldb/util/env_windows.cc:765–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763}
764
765void WindowsEnv::BackgroundThreadMain() {
766 while (true) {
767 background_work_mutex_.Lock();
768
769 // Wait until there is work to be done.
770 while (background_work_queue_.empty()) {
771 background_work_cv_.Wait();
772 }
773
774 assert(!background_work_queue_.empty());
775 auto background_work_function = background_work_queue_.front().function;
776 void* background_work_arg = background_work_queue_.front().arg;
777 background_work_queue_.pop();
778
779 background_work_mutex_.Unlock();
780 background_work_function(background_work_arg);
781 }
782}
783
784// Wraps an Env instance whose destructor is never created.
785//

Callers 1

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
emptyMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected