typo
tid -> ctypes.c_long(tid)