mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 01:37:53 +00:00
![]() When scheduling a thread, the scheduling function returns a pointer to the struct thread that was placed on one of the scheduling queues in the associated thread master. This pointer is used to check whether or not the thread is scheduled, and is passed to thread_cancel() should the daemon need to cancel that particular task. The thread_fetch() function is called to retrieve the next thread to execute. However, when it returns, the aforementioned pointer is not updated. As a result, in order for the above use cases to work, every thread handler function must set the associated pointer to NULL. This is bug prone, and moreover, not thread safe. This patch changes the thread scheduling functions to return void. If the caller needs a reference to the scheduled thread, it must pass in a pointer to store the pointer to the thread struct in. Subsequent calls to thread_cancel(), thread_cancel_event() or thread_fetch() will result in that pointer being nulled before return. These operations occur within the thread_master critical sections. Overall this should avoid bugs introduced by thread handler funcs forgetting to null the associated pointer, double-scheduling caused by overwriting pointers to currently scheduled threads without performing a nullity check, and the introduction of true kernel threads causing race conditions within the userspace threading world. Also removes the return value for thread_execute since it always returns null... Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> |
||
---|---|---|
bgpd | ||
debian | ||
doc | ||
eigrpd | ||
fpm | ||
gdb | ||
init | ||
isisd | ||
ldpd | ||
lib | ||
m4 | ||
nhrpd | ||
ospf6d | ||
ospfclient | ||
ospfd | ||
pimd | ||
pkgsrc | ||
ports | ||
qpb | ||
redhat | ||
ripd | ||
ripngd | ||
snapcraft | ||
solaris | ||
tests | ||
tools | ||
vtysh | ||
watchfrr | ||
zebra | ||
.gitignore | ||
AUTHORS | ||
bootstrap.sh | ||
buildtest.sh | ||
ChangeLog | ||
common.am | ||
COMMUNITY.md | ||
configure.ac | ||
COPYING | ||
COPYING-LGPLv2.1 | ||
defaults.h | ||
Makefile.am | ||
NEWS | ||
README | ||
README.NetBSD | ||
render_md.py | ||
REPORTING-BUGS | ||
SERVICES | ||
stamp-h.in | ||
update-autotools |
FRRouting is free software that manages various IPv4 and IPv6 routing protocols. Currently FRRouting supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, RIPng, PIM-SM/MSDP and LDP as well as very early support for IS-IS. See the file REPORTING-BUGS to report bugs. Free RRRouting is free software. See the file COPYING for copying conditions. Public email discussion can be found at https://lists.frrouting.org/listinfo Our public slack channel is at https://frrouting.slack.com