Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eci2ecef: thread safety, add THREADLOCAL #587

Open
wants to merge 1 commit into
base: demo5
Choose a base branch
from

Conversation

ourairquality
Copy link

Add a THREADLOCAL definition that maps to _Thread_local for C11, __thread for gcc, and __declspec(__thread) for MSC.

Use this to make the eci2ecef() cache thread safe.

Testing on linux. If people could test this on other platforms, and if there is a workable thread local declaration, then this could be useful in a few other places. Worst case the definition could be empty for platforms without thread local storage declarations and then these uses would remain not thread safe for now on these platforms. The MSC declaration is based on https://learn.microsoft.com/en-us/cpp/cpp/thread?view=msvc-170 For C11 _Thread_local appears to be usable, but RTKLIB currently targets C99 so this also maps to GCC amd MSC extensions.

Add a THREADLOCAL definition that maps to _Thread_local for C11,
__thread for gcc, and __declspec(__thread) for MSC.

Use this to make the eci2ecef() cache thread safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant