btio: Use G_PRIORITY_HIGH for watches
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 16 Feb 2021 22:51:04 +0000 (14:51 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
This makes btio watches default to G_PRIORITY_HIGH instead of
G_PRIORITY_DEFAULT so it takes priority over regular traffic or
timeout handling.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
btio/btio.c

index b4e1251..9a99ad8 100755 (executable)
@@ -274,7 +274,7 @@ static void server_add(GIOChannel *io, BtIOConnect connect,
        server->destroy = destroy;
 
        cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
-       g_io_add_watch_full(io, G_PRIORITY_DEFAULT, cond, server_cb, server,
+       g_io_add_watch_full(io, G_PRIORITY_HIGH, cond, server_cb, server,
                                        (GDestroyNotify) server_remove);
 }
 
@@ -291,7 +291,7 @@ static void connect_add(GIOChannel *io, BtIOConnect connect, bdaddr_t dst,
        conn->dst = dst;
 
        cond = G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
-       g_io_add_watch_full(io, G_PRIORITY_DEFAULT, cond, connect_cb, conn,
+       g_io_add_watch_full(io, G_PRIORITY_HIGH, cond, connect_cb, conn,
                                        (GDestroyNotify) connect_remove);
 }
 
@@ -307,7 +307,7 @@ static void accept_add(GIOChannel *io, BtIOConnect connect, gpointer user_data,
        accept->destroy = destroy;
 
        cond = G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
-       g_io_add_watch_full(io, G_PRIORITY_DEFAULT, cond, accept_cb, accept,
+       g_io_add_watch_full(io, G_PRIORITY_HIGH, cond, accept_cb, accept,
                                        (GDestroyNotify) accept_remove);
 }