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

Method run

test/cpp/src/StressTestNonBlocking.cpp:123–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 _loopType(loopType) {}
122
123 void run() override {
124
125 // Wait for all worker threads to start
126
127 {
128 Synchronized s(_monitor);
129 while (_workerCount == 0) {
130 _monitor.wait();
131 }
132 }
133
134 _startTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
135
136 _transport->open();
137
138 switch (_loopType) {
139 case T_VOID:
140 loopEchoVoid();
141 break;
142 case T_BYTE:
143 loopEchoByte();
144 break;
145 case T_I32:
146 loopEchoI32();
147 break;
148 case T_I64:
149 loopEchoI64();
150 break;
151 case T_STRING:
152 loopEchoString();
153 break;
154 default:
155 cerr << "Unexpected loop type" << _loopType << '\n';
156 break;
157 }
158
159 _endTime = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now().time_since_epoch()).count();
160
161 _transport->close();
162
163 _done = true;
164
165 {
166 Synchronized s(_monitor);
167
168 _workerCount--;
169
170 if (_workerCount == 0) {
171
172 _monitor.notify();
173 }
174 }
175 }
176
177 void loopEchoVoid() {
178 for (size_t ix = 0; ix < _loopCount; ix++) {

Callers

nothing calls this directly

Calls 6

nowFunction · 0.85
closeMethod · 0.65
waitMethod · 0.45
countMethod · 0.45
openMethod · 0.45
notifyMethod · 0.45

Tested by

no test coverage detected