lock.Lock();
++data.started;
++data.in_flight;
- snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
- lock.Unlock();
- if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
- cerr << name[slot] << " is not correct!" << std::endl;
- ++errors;
+ if (!no_verify) {
+ snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
+ lock.Unlock();
+ if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
+ cerr << name[slot] << " is not correct!" << std::endl;
+ ++errors;
+ }
+ } else {
+ lock.Unlock();
}
+
name[slot] = newName;
- delete cur_contents;
}
//wait for final reads to complete
lock.Lock();
++data.started;
++data.in_flight;
- snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
- lock.Unlock();
- if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
- cerr << name[slot] << " is not correct!" << std::endl;
- ++errors;
+ if (!no_verify) {
+ snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index);
+ lock.Unlock();
+ if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) {
+ cerr << name[slot] << " is not correct!" << std::endl;
+ ++errors;
+ }
+ } else {
+ lock.Unlock();
}
name[slot] = newName;
- delete cur_contents;
}
//wait for final reads to complete