ubuntu - Unable to get system thread id from python thread id in python 2.7 -
python 2.6 used have undocumented function called tmap. function not there in python 2.7.
this tmap function there in threading package. tried search function in 2.7 can provide similar functionality without luck.
i tried port tmap python 2.6.7 2.7. like:
def tmap():
ret = {} _active_limbo_lock.acquire() k, val in _active.items(): ret[k] = val._gettid() _active_limbo_lock.release() return ret where gettid like:
def _gettid(self): if self.__taskid == -1: try: self.__taskid = ctypes.cdll('libc.so.6').syscall(186) except: pass return self.__taskid however getting threadid of main thread. there changes in apis used here between python versions, causing this?
while porting missed _gettid in __bootstrap_inner method. think required called in context of thread. in case earlier getting called in context of main thread, hence result.
Comments
Post a Comment