windowsaio: fix completion thread affinitization
[fio.git] / engines / windowsaio.c
index 0e164b604b1b9b00c6a96601dbe1c57635a962e5..f5cb04838a31f70dc6cf801239e33df16800f54c 100644 (file)
@@ -113,10 +113,15 @@ static int fio_windowsaio_init(struct thread_data *td)
 
                if (!rc)
                {
+                       DWORD threadid;
+
                        ctx->iocp = hFile;
                        ctx->wd = wd;
-                       wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, NULL);
-                       if (wd->iothread == NULL)
+                       wd->iothread = CreateThread(NULL, 0, IoCompletionRoutine, ctx, 0, &threadid);
+
+                       if (wd->iothread != NULL)
+                               fio_setaffinity(threadid, td->o.cpumask);
+                       else
                                log_err("windowsaio: failed to create io completion thread\n");
                }