MCPcopy Create free account
hub / github.com/apache/thrift / run

Method run

lib/cpp/test/concurrency/ThreadManagerTests.h:59–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 : _monitor(monitor), _count(count), _timeout(timeout), _startTime(0), _endTime(0), _done(false) {}
58
59 void run() override {
60
61 _startTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
62
63 sleep_(_timeout);
64
65 _endTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
66
67 _done = true;
68
69 {
70 Synchronized s(_monitor);
71
72 // std::cout << "Thread " << _count << " completed " << '\n';
73
74 _count--;
75 if (_count % 10000 == 0) {
76 _monitor.notify();
77 }
78 }
79 }
80
81 Monitor& _monitor;
82 size_t& _count;

Callers

nothing calls this directly

Calls 4

nowFunction · 0.85
sleep_Function · 0.85
countMethod · 0.45
notifyMethod · 0.45

Tested by

no test coverage detected