Skip to content

Commit

Permalink
refactor: missing session_unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Mar 21, 2024
1 parent 271a488 commit e7e0b77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
9 changes: 2 additions & 7 deletions src/session/queryable.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ int8_t _z_trigger_queryables(_z_session_t *zn, const _z_msg_query_t *msgq, const
if (key._suffix != NULL) {
_z_session_queryable_rc_list_t *qles = __unsafe_z_get_session_queryable_by_key(zn, key);

#if Z_FEATURE_MULTI_THREAD == 1
zp_mutex_unlock(&zn->_mutex_inner);
#endif // Z_FEATURE_MULTI_THREAD == 1
_zp_session_unlock_mutex(zn);

// Build the z_query
z_query_t query = {._val = {._rc = _z_query_rc_new()}};
Expand All @@ -160,10 +158,7 @@ int8_t _z_trigger_queryables(_z_session_t *zn, const _z_msg_query_t *msgq, const
_z_keyexpr_clear(&key);
_z_session_queryable_rc_list_free(&qles);
} else {
#if Z_FEATURE_MULTI_THREAD == 1
zp_mutex_unlock(&zn->_mutex_inner);
#endif // Z_FEATURE_MULTI_THREAD == 1

_zp_session_unlock_mutex(zn);
ret = _Z_ERR_KEYEXPR_UNKNOWN;
}

Expand Down
8 changes: 2 additions & 6 deletions src/session/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ int8_t _z_trigger_subscriptions(_z_session_t *zn, const _z_keyexpr_t keyexpr, co
if (key._suffix != NULL) {
_z_subscription_rc_list_t *subs = __unsafe_z_get_subscriptions_by_key(zn, _Z_RESOURCE_IS_LOCAL, key);

#if Z_FEATURE_MULTI_THREAD == 1
zp_mutex_unlock(&zn->_mutex_inner);
#endif // Z_FEATURE_MULTI_THREAD == 1
_zp_session_unlock_mutex(zn);

// Build the sample
_z_sample_t s;
Expand All @@ -195,9 +193,7 @@ int8_t _z_trigger_subscriptions(_z_session_t *zn, const _z_keyexpr_t keyexpr, co
_z_keyexpr_clear(&key);
_z_subscription_rc_list_free(&subs);
} else {
#if Z_FEATURE_MULTI_THREAD == 1
zp_mutex_unlock(&zn->_mutex_inner);
#endif // Z_FEATURE_MULTI_THREAD == 1
_zp_session_unlock_mutex(zn);
ret = _Z_ERR_KEYEXPR_UNKNOWN;
}

Expand Down

0 comments on commit e7e0b77

Please sign in to comment.