On Mon, 28 Jun 2021 07:37:10 GMT, Yi Yang <yy...@openjdk.org> wrote:

>> src/hotspot/share/runtime/osThread.cpp line 41:
>> 
>>> 39: // Printing
>>> 40: void OSThread::print_on(outputStream *st) const {
>>> 41:   st->print("nid=%d ", thread_id());
>> 
>> thread_id is of an opaque type (eg pthread_t). I think we can reasonably 
>> assume its numeric, but I would print it as an unsigned 64bit int just in 
>> case.
>
> Hi Thomas, we can not use other format specifiers (`%ld`,`%llu`) after my 
> practice, because it can not compile on my mac:

You'd do:

print("nid: " UINT64_FORMAT, (uint64_t) id):;

thread_t is, among other things, pthread_t, which is opaque. Any current code 
treating that as signed int is incorrect too.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4449

Reply via email to