switchbrew / libnx

Library for Switch Homebrew

Home Page:https://switchbrew.github.io/libnx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Main thread's thread_ptr is always NULL

bouk opened this issue · comments

This is my situation. I'm using the C11 thread implementation of threads, and I'm running into an issue where I have a thrd_t value that I'm setting, and then later comparing to thrd_current. The issue is that thrd_current for the main thread is always NULL, so there is no way for me to check whether this thrd_t value is NULL, or referring to the main thread.

It would be nice if the main thread also had a Thread structure allocated for it, even if it doesn't do much. Right now I'm getting around it by having a sentinel value for thrd_t to refer to unset.

commented

Thank you for expressing your concern, I'll think of a solution. However, let me remind you that you should stick to stable releases (distributed via pacman) whenever possible. The next version of libnx isn't ready yet for prime time, and as you can see new features are incomplete and/or broken.