Fix cancel from locked + tests (bug 963640)
Merge pull request #27 from muffinresearch/fix-cancel-loop-test-cancel-from-locked

Fix cancel from locked + tests (bug 963640)