Merge "Fix pthread key num calculation."