[PATCH v2 2/2] wineserver: Fallback to RTKIT if direct modification of thread priority failed.

Alexandre Julliard julliard at winehq.org
Tue Oct 8 04:01:45 CDT 2019


Rémi Bernon <rbernon at codeweavers.com> writes:

> +static int rtkit_set_realtime( dbus_uint64_t process, dbus_uint64_t thread, dbus_uint32_t priority )
> +{
> +    DBusConnection* dbus = NULL;
> +    DBusMessage *msg = NULL, *rep = NULL;
> +    DBusError err;
> +    int ret = -1;
> +
> +    dbus_error_init(&err);
> +
> +    dbus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err);
> +    if (dbus_error_is_set(&err))
> +        goto error;
> +
> +    dbus_connection_set_exit_on_disconnect(dbus, 0);
> +
> +    if (!(msg = dbus_message_new_method_call("org.freedesktop.RealtimeKit1",
> +                                            "/org/freedesktop/RealtimeKit1",
> +                                            "org.freedesktop.RealtimeKit1",
> +                                            "MakeThreadRealtimeWithPID")))
> +        goto error;
> +
> +    if (!dbus_message_append_args(msg,
> +                                  DBUS_TYPE_UINT64, &process,
> +                                  DBUS_TYPE_UINT64, &thread,
> +                                  DBUS_TYPE_UINT32, &priority,
> +                                  DBUS_TYPE_INVALID))
> +        goto error;
> +
> +    if (!(rep = dbus_connection_send_with_reply_and_block(dbus, msg, -1, &err)))
> +        goto error;

I don't think we want to make blocking dbus calls from wineserver.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list