How to stop a render by script

Hey Guys,
I'm starting a render using DzRenderMgr::doRender(...) and I'd like to know if there is a way to click the "Cancel" button by script too. Also, the execution thread seems to become blocked after doRender() is called, so this solution must be smart.
Thanks in advance,
Oppai-Man