+ pthread_condattr_init(&attr);
+ pthread_cond_init(&td->verify_cond, &attr);
+ pthread_cond_init(&td->free_cond, &attr);
+
+ td_set_runstate(td, TD_INITIALIZED);
+ dprint(FD_MUTEX, "up startup_mutex\n");
+ fio_mutex_up(startup_mutex);
+ dprint(FD_MUTEX, "wait on td->mutex\n");
+ fio_mutex_down(td->mutex);
+ dprint(FD_MUTEX, "done waiting on td->mutex\n");
+
+ /*
+ * the ->mutex mutex is now no longer used, close it to avoid
+ * eating a file descriptor
+ */
+ fio_mutex_remove(td->mutex);
+
+ /*
+ * A new gid requires privilege, so we need to do this before setting
+ * the uid.
+ */
+ if (td->o.gid != -1U && setgid(td->o.gid)) {
+ td_verror(td, errno, "setgid");
+ goto err;
+ }
+ if (td->o.uid != -1U && setuid(td->o.uid)) {
+ td_verror(td, errno, "setuid");
+ goto err;
+ }
+
+ /*
+ * May alter parameters that init_io_u() will use, so we need to
+ * do this first.
+ */
+ if (init_iolog(td))
+ goto err;
+