* threads as they assess overlap.
*/
res = pthread_mutex_lock(&overlap_check);
- assert(res == 0);
+ if (fio_unlikely(res != 0)) {
+ log_err("failed to lock overlap check mutex, err: %i:%s", errno, strerror(errno));
+ abort();
+ }
retry:
- for_each_td(td, i) {
+ for_each_td(td) {
if (td->runstate <= TD_SETTING_UP ||
td->runstate >= TD_FINISHING ||
!td->o.serialize_overlap ||
continue;
res = pthread_mutex_unlock(&overlap_check);
- assert(res == 0);
+ if (fio_unlikely(res != 0)) {
+ log_err("failed to unlock overlap check mutex, err: %i:%s", errno, strerror(errno));
+ abort();
+ }
res = pthread_mutex_lock(&overlap_check);
- assert(res == 0);
+ if (fio_unlikely(res != 0)) {
+ log_err("failed to lock overlap check mutex, err: %i:%s", errno, strerror(errno));
+ abort();
+ }
goto retry;
- }
+ } end_for_each();
}
static int io_workqueue_fn(struct submit_worker *sw,
{
struct writer_thread *wt = data;
struct work_item *work;
- unsigned int seq = 1;
+ int seq = 1;
work = NULL;
- while (!wt->thread.exit || !flist_empty(&wt->list)) {
+ while (!(seq < 0) && (!wt->thread.exit || !flist_empty(&wt->list))) {
pthread_mutex_lock(&wt->thread.lock);
- if (work) {
+ if (work)
flist_add_tail(&work->list, &wt->done_list);
- work = NULL;
- }
work = find_seq(wt, seq);
if (work)