From f1f603c7d0b3f03dca46a4f313472288eb080eb1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 24 Dec 2014 01:10:47 +0000 Subject: making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247 --- src/transport/plugin_transport_udp_broadcasting.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/transport/plugin_transport_udp_broadcasting.c') diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index 9ed1bff65..6566245cd 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c @@ -84,7 +84,7 @@ struct BroadcastAddress /** * ID of select broadcast task */ - GNUNET_SCHEDULER_TaskIdentifier broadcast_task; + struct GNUNET_SCHEDULER_Task * broadcast_task; struct Plugin *plugin; @@ -302,7 +302,7 @@ udp_ipv4_broadcast_send (void *cls, uint16_t msg_size; char buf[65536] GNUNET_ALIGN; - baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK; + baddr->broadcast_task = NULL; msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf); if (0 != msg_size) @@ -379,7 +379,7 @@ udp_ipv6_broadcast_send (void *cls, char buf[65536] GNUNET_ALIGN; const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) baddr->addr; - baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK; + baddr->broadcast_task = NULL; msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf); /* Note: unclear if this actually works to limit the multicast to @@ -651,10 +651,10 @@ stop_broadcast (struct Plugin *plugin) { struct BroadcastAddress *p = plugin->broadcast_head; - if (p->broadcast_task != GNUNET_SCHEDULER_NO_TASK) + if (p->broadcast_task != NULL) { GNUNET_SCHEDULER_cancel (p->broadcast_task); - p->broadcast_task = GNUNET_SCHEDULER_NO_TASK; + p->broadcast_task = NULL; } if ((GNUNET_YES == plugin->enable_ipv6) && (NULL != plugin->sockv6) && -- cgit v1.2.3