We special-handle events with a TIMEOUT= set, so they don't get queued
or wait for parent events to finish, to make sure we can handle them
as fast as possible.
With this change we first try to find an idle worker process before
forking a new one.
}
}
-static void event_run(struct event *event)
+static void event_run(struct event *event, bool force)
{
struct udev_list_node *loop;
return;
}
- if (childs >= max_childs) {
+ if (!force && childs >= max_childs) {
info(event->udev, "maximum number (%i) of childs reached\n", childs);
return;
}
/* run all events with a timeout set immediately */
if (udev_device_get_timeout(dev) > 0) {
- worker_new(event);
+ event_run(event, true);
return;
}
}
continue;
}
- event_run(event);
+ event_run(event, false);
}
}