# \#thread-sanitizer

**URL:** https://forums.swift.org/tag/thread-sanitizer/631.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Noncopyable type has deinit called before init](https://forums.swift.org/t/noncopyable-type-has-deinit-called-before-init/72152)

<div class="topic-metadata">

**Author:** [@willft](https://forums.swift.org/u/willft)\
**Replies:** 6\
**Last updated:** [June 1, 2024, 2:53am UTC](https://forums.swift.org/t/noncopyable-type-has-deinit-called-before-init/72152 "2024-06-01T02:53:53Z")

</div>

Hi all, I’m experiencing just the weirdest bug. It seems like maybe a miscompile to me (or I've totally misunderstood vDSP.clear), but it’s at the crossroads of non-copyable types, the Accelerate framework, and thread sa…

---

## [Data race when concurrently calling C function using global variables](https://forums.swift.org/t/data-race-when-concurrently-calling-c-function-using-global-variables/66527)

<div class="topic-metadata">

**Author:** [@thebluepotato](https://forums.swift.org/u/thebluepotato)\
**Replies:** 11\
**Last updated:** [August 3, 2023, 8:30am UTC](https://forums.swift.org/t/data-race-when-concurrently-calling-c-function-using-global-variables/66527 "2023-08-03T08:30:22Z")

</div>

I've been using a binary written in C (pngnq-s9) to quantize PNG files to drastically reduce their size. Up to now, I've been calling the binary itself using Process/NSTask. Since multiple PNG files have to be processed,…

---

## [Thread Sanitizer with Task/Concurrency warnings](https://forums.swift.org/t/thread-sanitizer-with-task-concurrency-warnings/63260)

<div class="topic-metadata">

**Author:** [@rlovelett](https://forums.swift.org/u/rlovelett)\
**Replies:** 0\
**Last updated:** [February 21, 2023, 3:49pm UTC](https://forums.swift.org/t/thread-sanitizer-with-task-concurrency-warnings/63260 "2023-02-21T15:49:34Z")

</div>

I have found a few different topics on Thread Sanitizer (TSAN) and structured concurrency. One even seems to indicate that TSAN should work better with Xcode 14. I am getting what I believe is a false positive from TSA…

---

## [Thread sanitiser v mutex](https://forums.swift.org/t/thread-sanitiser-v-mutex/54515)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 2\
**Last updated:** [January 9, 2022, 6:18pm UTC](https://forums.swift.org/t/thread-sanitiser-v-mutex/54515 "2022-01-09T18:18:30Z")

</div>

I am getting thread sanitiser "Swift access race" on pthread\_mutex\_lock line. How do I use mutex properly in Swift? import Foundation class MiniTest { var mutex = pthread\_mutex\_t() init() { pthread…
