<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/lock-em-dead-req6ildod" -->

---
title: Lock 'Em Dead | daily.dev
description: A C++ exception handler meant to recover from a deadlock simply retries by jumping back to the top of a block without releasing the mutex the current thread...
canonical: https://daily.dev/posts/lock-em-dead-req6ildod
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Lock 'Em Dead | daily.dev
og:description: A C++ exception handler meant to recover from a deadlock simply retries by jumping back to the top of a block without releasing the mutex the current thread...
og:url: https://daily.dev/posts/lock-em-dead-req6ildod
og:image: https://api.daily.dev/og/posts/req6ILDOD.png
og:image:alt: Lock 'Em Dead
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Lock 'Em Dead

**[The Daily WTF](https://daily.dev/sources/thedailywtf)** · 2 min read · 1 upvotes · 0 comments

## Summary

A C++ exception handler meant to recover from a deadlock simply retries by jumping back to the top of a block without releasing the mutex the current thread holds, which does nothing to break the circular wait between two threads. A highly paid consultant brought in to fix existing deadlocks in the codebase appears to have introduced new ones with this retry macro, which is suspected to wrap a goto statement.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thedailywtf.com/articles/lock-em-dead>

## Questions this post answers

### why does retrying after catching a deadlock exception in C++ not actually fix the deadlock

Retrying after catching a deadlock exception does not fix anything if the retry logic simply jumps back to the top of the code block without releasing the resource the current thread is holding. A deadlock occurs because two threads each wait on a resource the other holds; unless one thread releases its resource first, looping back and retrying just recreates the same stuck condition indefinitely.

_Developers debugging mutex deadlocks can find real-world war stories like this one on daily.dev._

## Similar posts on daily.dev

- [A traffic jam where nobody can move. That’s deadlock. And the fix?](https://daily.dev/posts/a-traffic-jam-where-nobody-can-move-that-s-deadlock-and-the-fix--gecv7hpes) · Medium · 9 upvotes · 1 comments
- [Uncaught Exceptions in C\+\+](https://daily.dev/posts/uncaught-exceptions-in-c--9zdrjnh7f) · Jacek Galowicz · 0 upvotes · 0 comments
- [September 18, 2026](https://daily.dev/posts/september-18-2026-c1vxqpg7j) · The Old New Thing · 0 upvotes · 0 comments
- [IonStack part II: GhostLock, a stack-UAF that has existed in ALL Linux distributions for 15 years](https://daily.dev/posts/ionstack-part-ii-ghostlock-a-stack-uaf-that-has-existed-in-all-linux-distributions-for-15-years-wznoxduhk) · Hacker News · 2 upvotes · 0 comments

---

Tags: [#c++](https://daily.dev/tags/c++), [#code-review](https://daily.dev/tags/code-review)

[View this post on daily.dev](https://daily.dev/posts/lock-em-dead-req6ildod)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Lock 'Em Dead","url":"https://daily.dev/posts/lock-em-dead-req6ildod","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/lock-em-dead-req6ildod"},"datePublished":"2026-08-26T11:18:01.091Z","dateModified":"2026-09-14T09:14:13.420Z","description":"A C++ exception handler meant to recover from a deadlock simply retries by jumping back to the top of a block without releasing the mutex the current thread...","image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","thumbnailUrl":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","isAccessibleForFree":true,"articleSection":"The Daily WTF","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"The Daily WTF","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/d21a6aa61a7244d893a3b3284df8e2ef","url":"https://daily.dev/sources/thedailywtf"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/lock-em-dead-req6ildod","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c++,code-review","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Daily WTF","item":"https://daily.dev/sources/thedailywtf"},{"@type":"ListItem","position":3,"name":"Lock 'Em Dead"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/lock-em-dead-req6ildod#faq","mainEntity":[{"@type":"Question","name":"why does retrying after catching a deadlock exception in C++ not actually fix the deadlock","acceptedAnswer":{"@type":"Answer","text":"Retrying after catching a deadlock exception does not fix anything if the retry logic simply jumps back to the top of the code block without releasing the resource the current thread is holding. A deadlock occurs because two threads each wait on a resource the other holds; unless one thread releases its resource first, looping back and retrying just recreates the same stuck condition indefinitely. Developers debugging mutex deadlocks can find real-world war stories like this one on daily.dev."}}]}
```

