Re: PR_GetThreadID() fails with SEGV

Wan-Teh Chang <[email protected]> Sat, 13 Jun 2009 08:00:45 -0700
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
On Fri, Jun 12, 2009 at 7:17 PM, Jon Leighton<[email protected]> wrote:
> I'm using NSPR 4.8 on Solaris 5.10, and OpenSolaris 5.11, and if I call
> PR_GetThreadID(PR_GetCurrentThread()), it fails with SEGV.  The same code
> works fine on a number of other platforms.  Is there an issue with
> PR_GetThreadID() on Solaris/OpenSolaris, or something different I need to
> do?  Thanks for any help.

PR_GetThreadID() is a deprecated function because its return type
PRUint32 is too small to hold a native thread ID on some platforms
(if pthread_t is 64-bit).

But that means the problem should be a truncation of the native
thread ID, not a crash due to SEGV.

Since I don't have access to Solaris, I don't know what the problem
is.  I inspected the source code and didn't see anything wrong or
Solaris-specific.

Wan-Teh