Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#16170 closed enhancement (fixed)

wxThread handle getter

Reported by: troelsk Owned by: VZ
Priority: normal Milestone:
Component: base Version: dev-latest
Keywords: wxThread Cc:
Blocked By: Blocking:
Patch: no


Thread handle getter, MSWGetHandle(), in addition to the thread id getter, GetId().

(I need this to track threads; I'm tracking threads created, by handle, some created from C without a wxThread instance. Tracking by id is impractical/instrusive, would involve touching numerous 'stable' legacy modules)

Attachments (1)

threadhandle.patch download (1.5 KB) - added by troelsk 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by troelsk

comment:1 Changed 4 years ago by vadz

I wonder if it would make sense to have a "portable" GetHandle() returning the same thing as GetId() under the other platforms.

What do people think?

comment:2 Changed 4 years ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76418:

Add wxThread::MSWGetHandle().

Under MSW a thread has both an ID, returned by wxThread::GetId(), and a
handle, which couldn't be retrieved so far. Add an accessor to do it.

Closes #16170.

comment:3 Changed 4 years ago by troelsk

Thanks! This helped me out of a pinch. And the handle is more useful than the id on Windows, the API is using handles almost exclusively (except for PostThreadMessage)

Note: See TracTickets for help on using tickets.