On DragonFly BSD, threading.get_native_id() returns lwp_gettid(), which is only unique within a process (the main thread is LWP 1 in every process), so it is not unique across processes as on other platforms.
This makes test_native_id_after_fork and test_process_mainthread_native_id fail with AssertionError: 1 == 1.
Solaris had the same problem (gh-137884), fixed by combining the thread id with the process id. DragonFly can do the same.
Linked PRs
- gh-154283: Make threading.get_native_id() unique across processes on DragonFly #154287
- [3.15] gh-154283: Make threading.get_native_id() unique across processes on DragonFly (GH-154287) #154293
- [3.14] gh-154283: Make threading.get_native_id() unique across processes on DragonFly (GH-154287) #154297
- [3.13] gh-154283: Make threading.get_native_id() unique across processes on DragonFly (GH-154287) #154298