diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-07-24 20:27:45 +0200 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-07-24 22:32:08 +0400 |
commit | 37e2a417a6cb6a981c85dfdcd3245a48f99a4165 (patch) | |
tree | a29eee76eae6323d29c62c86492bb674446d5f80 /accel-pppd/include | |
parent | 31e20f0ce4605b7d7ec416bf88a4e98c90aa6b93 (diff) | |
download | accel-ppp-37e2a417a6cb6a981c85dfdcd3245a48f99a4165.tar.gz accel-ppp-37e2a417a6cb6a981c85dfdcd3245a48f99a4165.zip |
triton: Fix race upon termination
The triton_terminate() function works by setting the need_close flag
of each triton context, then queues this context for execution by a
triton thread if not already running. But if the context is already
being run by a triton thread, it may not notice that its need_close
flag has been updated (this flag is only checked at the beginning
of ctx_thread()). So if no other event wakes up that context (i.e.
if ctx_thread() isn't run again), it will never terminate.
This patch moves the need_close flag check at the end of ctx_thread()
so that a triton context can take the need_close flag into account
event if it's updated while running.
The context spinlock is also used to protect the need_close flag as
it is concurrently updated by triton_terminate().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/include')
0 files changed, 0 insertions, 0 deletions