runtime.set_from_double(secondsToRun);
stopTime = data.start_time + runtime;
+ slot = 0;
while( ceph_clock_now(g_ceph_context) < stopTime ) {
lock.Lock();
+ bool found = false;
while (1) {
- for (slot = 0; slot < concurrentios; ++slot) {
+ int old_slot = slot;
+ do {
if (completion_is_done(slot)) {
+ found = true;
break;
}
- }
- if (slot < concurrentios) {
- break;
- }
+ slot++;
+ if (slot == concurrentios) {
+ slot = 0;
+ }
+ } while (slot != old_slot);
+ if (found)
+ break;
lc.cond.Wait(lock);
}
lock.Unlock();
char* newName;
bufferlist *cur_contents;
+ slot = 0;
while (seconds_to_run && (ceph_clock_now(g_ceph_context) < finish_time) &&
num_objects > data.started) {
lock.Lock();
+ int old_slot = slot;
+ bool found = false;
while (1) {
- for (slot = 0; slot < concurrentios; ++slot) {
+ do {
if (completion_is_done(slot)) {
+ found = true;
break;
}
- }
- if (slot < concurrentios) {
+ slot++;
+ if (slot == concurrentios) {
+ slot = 0;
+ }
+ } while (slot != old_slot);
+ if (found) {
break;
}
lc.cond.Wait(lock);