diff --git a/src/main.cpp b/src/main.cpp index f79eba79..8a37c19a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -293,10 +293,15 @@ class TCMUDevLoop { struct tcmulib_cmd *cmd; obd_dev *odev = (obd_dev *)tcmu_dev_get_private(dev); tcmulib_processing_start(dev); + bool got_cmd = false; while ((cmd = tcmulib_get_next_command(dev, 0)) != NULL) { + got_cmd = true; odev->inflight++; threadpool.thread_create(&handle, new handle_args{dev, cmd}); } + if (!got_cmd) { + photon::thread_usleep(1000); + } return 0; }