Skip to content

Commit 33c3a13

Browse files
committed
Renamed destroy_pubsub_msg to pubsub_msg_unref.
1 parent e2b44d3 commit 33c3a13

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/pubsub.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ static map_ret_code tell_if(void *data, const char *key, void *value);
1010
static ps_priv_t *create_pubsub_msg(const void *message, const self_t *sender, const char *topic,
1111
enum msg_type type, const size_t size, const bool autofree);
1212
static map_ret_code tell_global(void *data, const char *key, void *value);
13-
static void destroy_pubsub_msg(ps_priv_t *pubsub_msg);
13+
static void pubsub_msg_unref(ps_priv_t *pubsub_msg);
1414
static module_ret_code tell_pubsub_msg(ps_priv_t *m, mod_t *mod, ctx_t *c, const bool global);
1515
static module_ret_code send_msg(const mod_t *mod, mod_t *recipient,
1616
const char *topic, const void *message,
@@ -85,7 +85,7 @@ static map_ret_code tell_global(void *data, const char *key, void *value) {
8585
return MAP_OK;
8686
}
8787

88-
static void destroy_pubsub_msg(ps_priv_t *pubsub_msg) {
88+
static void pubsub_msg_unref(ps_priv_t *pubsub_msg) {
8989
/* Properly free pubsub msg if its ref count reaches 0 and autofree bit is true */
9090
if (pubsub_msg->refs == 0 || --pubsub_msg->refs == 0) {
9191
if (pubsub_msg->autofree) {
@@ -106,7 +106,7 @@ static module_ret_code tell_pubsub_msg(ps_priv_t *m, mod_t *mod, ctx_t *c, const
106106

107107
/* Nobody received our message; destroy it right away */
108108
if (m->refs == 0) {
109-
destroy_pubsub_msg(m);
109+
pubsub_msg_unref(m);
110110
}
111111

112112
return MOD_OK;
@@ -150,7 +150,7 @@ map_ret_code flush_pubsub_msgs(void *data, const char *key, void *value) {
150150
run_pubsub_cb(mod, &msg);
151151
} else {
152152
MODULE_DEBUG("Destroying enqueued pubsub message for module '%s'.\n", mod->name);
153-
destroy_pubsub_msg(mm);
153+
pubsub_msg_unref(mm);
154154
}
155155
}
156156
return 0;
@@ -166,7 +166,7 @@ void run_pubsub_cb(mod_t *mod, msg_t *msg) {
166166
cb(msg, mod->userdata);
167167

168168
if (msg->is_pubsub) {
169-
destroy_pubsub_msg((ps_priv_t *)msg->ps_msg);
169+
pubsub_msg_unref((ps_priv_t *)msg->ps_msg);
170170
}
171171
}
172172

0 commit comments

Comments
 (0)