harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <ndbe...@apache.org>
Subject [drlvm] thread local storage in open/hythread.h
Date Sat, 29 Mar 2008 16:43:44 GMT
In open/hythread.h there is the following bit of code.

#ifdef PLATFORM_POSIX
extern __thread hythread_t tm_self_tls;
#else
extern __declspec(thread) hythread_t tm_self_tls;
#endif //PLATFORM_POSIX


hy_inline hythread_t VMCALL hythread_self() {
    return tm_self_tls;
}

>From what I know at the moment, the use of '__thread' isn't a POSIX
standard, but rather a gcc extension and '__declspec(thread)' is a
MSVC thing, so the check isn't quite correct. Neither of these works
on MacOS X and from what I've been able to gather, it shouldn't work
on FreeBSD, but I can't confirm that. In any case, I was looking at
implementing this for MacOSX and FreeBSD using pthread_key_t. It seems
like that could be used for other (all?) platforms as well. Any
thoughts on that?

-Nathan

Mime
View raw message