anfedorov / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Using actual os thread ids for get_process_threads #388

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
    By using a second call to thread_info with a different call, one can get actual thread_ids on os x. The id is the same as the one returned by a call to syscall(SYS_thread_selfid).
    This is a change we made because the use of dummy ids mean that the snapshot can be inconsistent (if thread 0 dies, then thread 1 will become thread 0 at the next snapshot)

Original issue reported on code.google.com by adrien.f...@gmail.com on 31 May 2013 at 5:10

Attachments:

GoogleCodeExporter commented 8 years ago
Tested this patch. There are a couple minor issues with variable names not 
matching up with the earlier declarations, but otherwise it looks good to me.  
I'll mark this duplicate of Issue #224 and merge the patch in.

Original comment by jlo...@gmail.com on 3 Jun 2013 at 1:25