deadlock sample and impl