openocd/src
Paul Fertser b71ae9b1a7 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>
2015-03-09 06:40:04 +00:00
..
flash flash/nor/stellaris: remove dead assignment 2015-03-09 06:33:53 +00:00
helper configure: define WIN32_LEAN_AND_MEAN early to make it effective 2015-02-04 21:56:55 +00:00
jtag stlink: avoid null pointer dereference in stlink_usb_close() 2015-03-09 06:38:52 +00:00
pld update files to correct FSF address 2013-06-05 19:52:42 +00:00
rtos rtos: Freescale MQX rtos support 2015-03-09 06:29:17 +00:00
server server: tcl_notifications command 2015-03-09 06:30:30 +00:00
svf Openocd: svf: Add ability to ignore svf_check_tdo errors 2014-07-03 18:08:48 +00:00
target target: fix timer callbacks processing 2015-03-09 06:40:04 +00:00
transport transport: clarify error message when transport is not selected 2015-01-09 08:48:18 +00:00
xsvf update files to correct FSF address 2013-06-05 19:52:42 +00:00
hello.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
hello.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
main.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
Makefile.am Makefile.am: link libusb-1.0 after libusb-0.1 to fix dependencies 2015-02-04 21:56:45 +00:00
openocd.c Added system signal handling to Linux version 2015-03-09 06:25:45 +00:00
openocd.h Fix some problems with the bin2char utility 2014-08-02 09:01:32 +00:00