]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Atomically update the global gMsgId in libnetgraph.
authormarkj <markj@FreeBSD.org>
Fri, 10 May 2019 16:43:47 +0000 (16:43 +0000)
committermarkj <markj@FreeBSD.org>
Fri, 10 May 2019 16:43:47 +0000 (16:43 +0000)
commit206be58c8b2f3fef8eee0f94defb90d85ae7dee8
tree4eb5d1d51411b9e3cfe64eea8cba31b7e98d8dd0
parent0e9f9c3fbce70b0472f53485afcb6b77c4fd5eae
Atomically update the global gMsgId in libnetgraph.

Otherwise concurrently running threads may inadvertently use the same
token for different messages.

Preserve the behaviour of disallowing negative message tokens, but allow
a message token value of zero since this simplifies the code a bit and
tokens are documented to be non-negative.

PR: 234442
Reported and tested by: eugen
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
lib/libnetgraph/msg.c