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

Method BackgroundThreadMain

src/leveldb/util/env_posix.cc:815–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

813}
814
815void PosixEnv::BackgroundThreadMain() {
816 while (true) {
817 background_work_mutex_.Lock();
818
819 // Wait until there is work to be done.
820 while (background_work_queue_.empty()) {
821 background_work_cv_.Wait();
822 }
823
824 assert(!background_work_queue_.empty());
825 auto background_work_function = background_work_queue_.front().function;
826 void* background_work_arg = background_work_queue_.front().arg;
827 background_work_queue_.pop();
828
829 background_work_mutex_.Unlock();
830 background_work_function(background_work_arg);
831 }
832}
833
834namespace {
835

Callers 1

Calls 4

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

Tested by

no test coverage detected