mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
This fixes #755. The pthread ID cannot be reused as soon as the thread ends, because another thread needs to join it first. `pthread_self()` uses the native (i.e. RIOT's) thread ID to distinguish itself. A native thread ID can be reused as soon as the thread ends, since the core knows no join operation. In order to not confuse itself with an earlier zombie thread (i.e a dead non-detached thread, that was not joined, yet), we need to invalidate the associated native thread ID. This approach is sane since a dead thread won't call `pthread_self()` anymore.