birdman
Moderator
FIXED!!!! (I believe...).
So, both parts are needed.
After several days of adding lots of debug statements to the C++ code (and having to turn on RTTI [or rather, turn -fno_rtti off], so that I could print debug info for just the 3 types of ePtr I needed, not all 114 of them) I was able to set up just 3 timers in one order which worked, and one order which didn't. Looking at the debug output it seemed that there was a destructor call missing as the code went back into TimerSanityCheck.py. So I finally had a look at that and, indeed, there are 3 variables that hang on to references as timers are added. The result of this was that if the timer that is ending is the same one as was last started up, its FrontEnd (tuner) doesn't get released when it should, and hence continues to be "busy".
Setting the three variables to None at the end of the start-up tests clears this problem. Interestingly the end timer code already had such a var = None setting.
So I've managed to learn a lot more about C++ templates, and about Python's (lack of) variable scoping.
The patch is at
under SanityCheck. It also includes the test for completed timers, so that the Done timers passed in at boot time aren't check (there is no way they can clash) - and also mentions a possible way to speed up the check in general, but I haven't coded that yet.
Just as well I did, as I'd put in two parts to fix it. Part1 didn't work, so I added part2, which did. So I was just going to remove part1, but a test showed that although that did allow my test recordings to be added without clashes, it was clear from the log that it was "working but still wrong" (the destructor was still called late, but not so late that the clash was reported).Just need to do some more testing - and at the moment I've have imminent recordings.
So, both parts are needed.
After several days of adding lots of debug statements to the C++ code (and having to turn on RTTI [or rather, turn -fno_rtti off], so that I could print debug info for just the 3 types of ePtr I needed, not all 114 of them) I was able to set up just 3 timers in one order which worked, and one order which didn't. Looking at the debug output it seemed that there was a destructor call missing as the code went back into TimerSanityCheck.py. So I finally had a look at that and, indeed, there are 3 variables that hang on to references as timers are added. The result of this was that if the timer that is ending is the same one as was last started up, its FrontEnd (tuner) doesn't get released when it should, and hence continues to be "busy".
Setting the three variables to None at the end of the start-up tests clears this problem. Interestingly the end timer code already had such a var = None setting.
So I've managed to learn a lot more about C++ templates, and about Python's (lack of) variable scoping.
The patch is at
Code:
http://birdman.dynalias.org/OpenVix/