Skip to content

Commit

Permalink
Revert "jackdbus: Stop recurrent wakeups when no save is pending"
Browse files Browse the repository at this point in the history
device reservation also needs loop to run

so revert until better fix for idling is available

This reverts commit aef0259.
  • Loading branch information
nedko committed Sep 1, 2024
1 parent d6e498e commit c26a8fc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ News

* jackdbus 2.23.2 (2024-MM-DD)

* Stop recurrent wakeups when no save is pending (Stefan Bruens)
* Upgrade waf to 2.1.2

* jackdbus 2.23.1 (2024-06-13)
Expand Down
7 changes: 3 additions & 4 deletions dbus/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,15 +720,15 @@ jack_controller_destroy(
free(controller_ptr);
}

bool
void
jack_controller_run(
void * context)
{
struct sysinfo si;

if (controller_ptr->pending_save == 0)
{
return false;
return;
}

if (sysinfo(&si) != 0)
Expand All @@ -737,12 +737,11 @@ jack_controller_run(
}
else if (si.uptime < controller_ptr->pending_save + 2) /* delay save by two seconds */
{
return true;
return;
}

controller_ptr->pending_save = 0;
jack_controller_settings_save_auto(controller_ptr);
return false;
}

#undef controller_ptr
Expand Down
4 changes: 1 addition & 3 deletions dbus/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
#ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED
#define CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED

#include <stdbool.h>

void *
jack_controller_create(
DBusConnection *connection);

bool
void
jack_controller_run(
void *controller_ptr);

Expand Down
6 changes: 2 additions & 4 deletions dbus/jackdbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ main (int argc, char **argv)
void *controller_ptr;
struct stat st;
char timestamp_str[26];
bool save_pending;

st.st_mtime = 0;
stat(argv[0], &st);
Expand Down Expand Up @@ -955,10 +954,9 @@ main (int argc, char **argv)
jack_info("Listening for D-Bus messages");

g_exit_command = FALSE;
save_pending = false;
while (!g_exit_command && dbus_connection_read_write_dispatch (g_connection, (save_pending ? 200 : -1)))
while (!g_exit_command && dbus_connection_read_write_dispatch (g_connection, 200))
{
save_pending = jack_controller_run(controller_ptr);
jack_controller_run(controller_ptr);
}

jack_controller_destroy(controller_ptr);
Expand Down

0 comments on commit c26a8fc

Please sign in to comment.