Thanks to visit codestin.com
Credit goes to github.com

Skip to content

compiler warning related to thread id debug logging #85

@ThomasWaldmann

Description

@ThomasWaldmann

From @mgorny in https://github.com/python-llfuse/python-llfuse/pull/80/files/102d4756b856646f1fc940170f2b69f03812c0f3#diff-440f3a2515847d1da342d710f9f5d91764986974db11f639a80039ed608e3845 :

I'm afraid this is a non-trivial problem. Roughly, you could:

  1. "dump" pthread_t but it's probably not worth the complexity for a debug print (basically print it as hex byte-by-byte)
  2. use non-portable getter inside the thread to get its numeric TID and pass it but it's complex and then you'd need extra compatibility if different platforms are involved, see e.g. https://github.com/llvm/llvm-project/blob/llvmorg-16.0.3/llvm/lib/Support/Unix/Threading.inc#L113-L134
  3. just create your own thread numbers and assign them consecutively (e.g. thread 1, thread 2 and so on)

See e.g. https://stackoverflow.com/questions/1759794/how-to-print-pthread-t

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions