aboutsummaryrefslogtreecommitdiff
path: root/src/target/register.c
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2015-02-11 10:51:17 +0300
committerPaul Fertser <fercerpav@gmail.com>2015-03-09 06:40:04 +0000
commitb71ae9b1a704a9631698d7d4a92b1dfdfc9a0f69 (patch)
tree1df6dc27a96322806ce86ac922973aa37e9b99d9 /src/target/register.c
parentca0e237d39a8e50c702cec4d825c4b44d63e4d4a (diff)
target: fix timer callbacks processing
Warning, behaviour change: before this patch if a timer callback returned an error, the other handlers in the list were not called. This patch fixes two different issues with the way timer callbacks are called: 1. The function is not designed to be reentrant but a nested call is possible via: target_handle timer event -> poll -> target events before/after reexaminantion -> script_command_run -> target_call_timer_callbacks_now . This patch makes function a no-op when called recursively; 2. The current code can deal with the case when calling a handler leads to its removal but not when it leads to removal of the next callback in the list. This patch defers actual removal to consolidate it with the calling loop. These bugs were exposed by Valgrind. Change-Id: Ia628a744634f5d2911eb329747e826cb9772e789 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2541 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target/register.c')
0 files changed, 0 insertions, 0 deletions