* ensures next time we start spawning worker threads
* the first thread will have number zero on its name.
*/
- if (!workers_active) {
+ if (!workers_active)
worker_count = 0;
- /*
- * Kick the job poller, just to print the time of next
- * update on the logs
- */
- notify_job_request();
- }
+ /*
+ * Kick the job poller. If all jobs were active at this point
+ * the scheduler thread will wait indefinitely until someone
+ * tells it to do something. We may now know when next job is
+ * available, so it is better for the scheduler to recalculate
+ * its sleep time.
+ */
+ notify_job_request();
mutex_unlock(&work_stats_mutex);
pid = run_piped(cmd, argv, i, o, e);
if (stdinf) {
- *stdinf = fdopen(ifd, "r");
+ *stdinf = fdopen(ifd, "w");
if (*stdinf == NULL) {
pr_err("Error opening file stream for fd %d: %m\n",
ifd);
}
if (stdoutf) {
- *stdoutf = fdopen(ofd, "w");
+ *stdoutf = fdopen(ofd, "r");
if (*stdoutf == NULL) {
pr_err("Error opening file stream for fd %d: %m\n",
ofd);
goto out_lock;
contended = 1;
- pr_info("Lock contention at %s:%d on lock %s acquired by %s at %s:%d\n",
+ pr_debug("Lock contention at %s:%d on lock %s acquired by %s at %s:%d\n",
file, line, lock->name,
lock->owner_name, lock->file, lock->line);
out_lock:
if (contended)
- pr_info("Lock %s acquired at %s:%d after contention\n",
+ pr_debug("Lock %s acquired at %s:%d after contention\n",
lock->name, file, line);
_mutex_lock_acquired(lock, file, line);
return ret;