modified pthread lookup