Cocoa - Core Animation - How to stop proxy animation?

I've got an application that does pretty much this (the menu bar covering window in Shroud) and answering this question I found a bug in it—although my animations are 0.1s so it would probably never be triggered in practice. But thanks. :-)

Animation durations of 0s are special-cased to behave just like setting the alpha value directly, so you can't use them, but you can use a very small duration, something like this, which will create a new animation that supersedes the in-progress one:

[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration:0.01];
[[myWindow animator] setAlphaValue:0.5];
[NSAnimationContext endGrouping];