Opened 9 months ago

Closed 8 months ago

Last modified 8 months 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

Description

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 9 months ago.

Download all attachments as: .zip

Change History (4)

Changed 9 months ago by troelsk

comment:1 Changed 8 months 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 8 months 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 8 months 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.