- struct syslet_data *sd = td->io_ops->data;
- struct syslet_uatom *done;
-
- if (!sd->head)
- return 0;
-
- assert(!sd->tail->next);
-
- if (!sd->ahu.new_thread_stack)
- sd->ahu.new_thread_stack = thread_stack_alloc();
-
- fio_syslet_queued(td, sd);
-
- /*
- * On sync completion, the atom is returned. So on NULL return
- * it's queued asynchronously.
- */
- done = async_exec(sd->head, &sd->ahu);
-
- if (done == (void *) -1) {
- log_err("fio: syslets don't appear to work\n");
- return -1;
- }
-
- sd->head = sd->tail = NULL;
-
- if (done)
- fio_syslet_complete_atom(td, done);
-
- return 0;