mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
dbus: check cx and vh locks via dbus_ctx
This commit is contained in:
parent
2760c9b0be
commit
281ed171a3
1 changed files with 8 additions and 7 deletions
|
@ -68,8 +68,8 @@ __lws_shadow_wsi(struct lws_dbus_ctx *ctx, DBusWatch *w, int fd, int create_ok)
|
||||||
if (!create_ok)
|
if (!create_ok)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
lws_context_assert_lock_held(wsi->a.context);
|
lws_context_assert_lock_held(ctx->vh->context);
|
||||||
lws_vhost_assert_lock_held(wsi->a.vhost);
|
lws_vhost_assert_lock_held(ctx->vh);
|
||||||
|
|
||||||
/* requires context lock */
|
/* requires context lock */
|
||||||
wsi = __lws_wsi_create_with_role(ctx->vh->context, ctx->tsi, NULL,
|
wsi = __lws_wsi_create_with_role(ctx->vh->context, ctx->tsi, NULL,
|
||||||
|
@ -155,11 +155,11 @@ lws_dbus_add_watch(DBusWatch *w, void *data)
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
lws_context_lock(pt->context, __func__);
|
lws_context_lock(pt->context, __func__);
|
||||||
lws_pt_lock(pt, __func__);
|
lws_vhost_lock(ctx->vh);
|
||||||
|
|
||||||
wsi = __lws_shadow_wsi(ctx, w, dbus_watch_get_unix_fd(w), 1);
|
wsi = __lws_shadow_wsi(ctx, w, dbus_watch_get_unix_fd(w), 1);
|
||||||
|
lws_vhost_unlock(ctx->vh);
|
||||||
if (!wsi) {
|
if (!wsi) {
|
||||||
lws_pt_unlock(pt);
|
|
||||||
lws_context_unlock(pt->context);
|
lws_context_unlock(pt->context);
|
||||||
lwsl_err("%s: unable to get wsi\n", __func__);
|
lwsl_err("%s: unable to get wsi\n", __func__);
|
||||||
|
|
||||||
|
@ -191,9 +191,9 @@ lws_dbus_add_watch(DBusWatch *w, void *data)
|
||||||
data, lws_flags);
|
data, lws_flags);
|
||||||
|
|
||||||
if (lws_flags)
|
if (lws_flags)
|
||||||
|
/* does its own pt lock */
|
||||||
__lws_change_pollfd(wsi, 0, (int)lws_flags);
|
__lws_change_pollfd(wsi, 0, (int)lws_flags);
|
||||||
|
|
||||||
lws_pt_unlock(pt);
|
|
||||||
lws_context_unlock(pt->context);
|
lws_context_unlock(pt->context);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -237,9 +237,10 @@ lws_dbus_remove_watch(DBusWatch *w, void *data)
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
lws_context_lock(pt->context, __func__);
|
lws_context_lock(pt->context, __func__);
|
||||||
lws_pt_lock(pt, __func__);
|
lws_vhost_lock(ctx->vh);
|
||||||
|
|
||||||
wsi = __lws_shadow_wsi(ctx, w, dbus_watch_get_unix_fd(w), 0);
|
wsi = __lws_shadow_wsi(ctx, w, dbus_watch_get_unix_fd(w), 0);
|
||||||
|
lws_vhost_unlock(ctx->vh);
|
||||||
if (!wsi)
|
if (!wsi)
|
||||||
goto bail;
|
goto bail;
|
||||||
|
|
||||||
|
@ -262,10 +263,10 @@ lws_dbus_remove_watch(DBusWatch *w, void *data)
|
||||||
__func__, w, dbus_watch_get_unix_fd(w),
|
__func__, w, dbus_watch_get_unix_fd(w),
|
||||||
data, lws_flags);
|
data, lws_flags);
|
||||||
|
|
||||||
|
/* does its own pt lock */
|
||||||
__lws_change_pollfd(wsi, (int)lws_flags, 0);
|
__lws_change_pollfd(wsi, (int)lws_flags, 0);
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
lws_pt_unlock(pt);
|
|
||||||
lws_context_unlock(pt->context);
|
lws_context_unlock(pt->context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue