Merge pull request #6 from normanmaurer/submit

Only need to do syscall if something was submitted
This commit is contained in:
Josef Grieb 2020-08-30 14:06:08 +02:00 committed by GitHub
commit 43fc06e9cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,10 +288,11 @@ final class IOUringSubmissionQueue {
public void submit() {
int submitted = flushSqe();
logger.trace("Submitted: {}", submitted);
int ret = Native.ioUringEnter(ringFd, submitted, 0, 0);
if (ret < 0) {
throw new RuntimeException("ioUringEnter syscall");
if (submitted > 0) {
int ret = Native.ioUringEnter(ringFd, submitted, 0, 0);
if (ret < 0) {
throw new RuntimeException("ioUringEnter syscall");
}
}
}