Commit 1de59c7c authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

copperplate/timerobj: fix start/start, start/stop races

Concurrent timer start vs start, or start vs stop operations may end
up confusing the logic, like:

- a periodic timer being reinserted into the dispatch queue while
  disabled.

- dirty reads of inconsistent ( date, interval, handler ) triplets by
  the dispatch loop, as the timer properties are being updated
  concurrently.

Fix this by moving all updates to the timer properties under the
protection of the dispatch lock (svlock), likewise for loads.

Issue reported by Ronny Meeus, with a preliminary fix:
https://xenomai.org/pipermail/xenomai/2020-December/043907.htmlSigned-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 24592c28
Pipeline #5603 failed with stage
in 15 minutes and 58 seconds