Skip to content

Commit 7f9ca09

Browse files
committed
Merge branch 'main' into manual-puback
2 parents e8c4717 + 5bf71d3 commit 7f9ca09

8 files changed

Lines changed: 426 additions & 102 deletions

File tree

.github/workflows/handle-stale-discussions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: HandleStaleDiscussions
22
on:
33
schedule:
4-
- cron: '0 */4 * * *'
4+
- cron: "0 9 * * 1"
55
discussion_comment:
66
types: [created]
77

@@ -15,4 +15,4 @@ jobs:
1515
- name: Stale discussions action
1616
uses: aws-github-ops/handle-stale-discussions@v1
1717
env:
18-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
18+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/stale_issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "Close stale issues"
33
# Controls when the action will run.
44
on:
55
schedule:
6-
- cron: "*/60 * * * *"
6+
- cron: "0 9 * * 1"
77

88
jobs:
99
cleanup:

include/aws/mqtt/private/client_impl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include <aws/common/hash_table.h>
1818
#include <aws/common/mutex.h>
19+
#include <aws/common/rw_lock.h>
1920
#include <aws/common/task_scheduler.h>
2021

2122
#include <aws/io/channel.h>
@@ -28,15 +29,19 @@ struct aws_mqtt_client_connection_311_impl;
2829

2930
#define MQTT_CLIENT_CALL_CALLBACK(client_ptr, callback) \
3031
do { \
32+
aws_rw_lock_rlock(&(client_ptr)->callback_lock); \
3133
if ((client_ptr)->callback) { \
3234
(client_ptr)->callback((&client_ptr->base), (client_ptr)->callback##_ud); \
3335
} \
36+
aws_rw_lock_runlock(&(client_ptr)->callback_lock); \
3437
} while (false)
3538
#define MQTT_CLIENT_CALL_CALLBACK_ARGS(client_ptr, callback, ...) \
3639
do { \
40+
aws_rw_lock_rlock(&(client_ptr)->callback_lock); \
3741
if ((client_ptr)->callback) { \
3842
(client_ptr)->callback((&client_ptr->base), __VA_ARGS__, (client_ptr)->callback##_ud); \
3943
} \
44+
aws_rw_lock_runlock(&(client_ptr)->callback_lock); \
4045
} while (false)
4146

4247
#if ASSERT_LOCK_HELD
@@ -278,6 +283,9 @@ struct aws_mqtt_client_connection_311_impl {
278283
aws_mqtt_on_operation_statistics_fn *on_any_operation_statistics;
279284
void *on_any_operation_statistics_ud;
280285

286+
/* Read-write lock to protect callbacks from being modified during callback execution */
287+
struct aws_rw_lock callback_lock;
288+
281289
/* listener callbacks */
282290
struct aws_mqtt311_callback_set_manager callback_manager;
283291

0 commit comments

Comments
 (0)