Rfc6810 bis

pull request for reviewing code
if it returns here, the lock is still held, deadlock