MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / doCommit

Method doCommit

Misc/GenericDataSaver.cpp:177–200  ·  view source on GitHub ↗

Protected by mutex

Source from the content-addressed store, hash-verified

175
176// Protected by mutex
177void
178GenericDataSaver::doCommit(void)
179{
180 // It is okay if the worker thread is still dumping data. This is
181 // just a way to signal this situation. If it was not ready, we
182 // do not flip buffers and keep filling the current one.
183 if (this->bufferReady) {
184 struct timeval otv = this->lastCommit;
185 struct timeval sub;
186
187 gettimeofday(&this->lastCommit, nullptr);
188 timersub(&this->lastCommit, &otv, &sub);
189 this->writeTime = static_cast<quint64>(
190 sub.tv_usec + sub.tv_sec * 1000000l);
191
192 this->buffer = 1 - this->buffer;
193 this->commitedSize = this->ptr;
194 this->size += this->commitedSize;
195 this->ptr = 0;
196 this->bufferReady = false;
197
198 emit commit();
199 }
200}
201
202void
203GenericDataSaver::setSampleRate(unsigned int rate)

Callers 1

writeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected