Thread the needle is a great way to open the hips by way of externally rotating the femur bone. This exercise helps gets your body ready for pigeon pose.
When doing this pose, be sure you don't feel any pain. If you feel pain you should stop.
Be cognizant of the angle at the knee joint. You want the knee joint to be at a 90 degree angle. By putting the knee into 90 degrees you force the femur to rotate at the hip joint.
This should feel like a comfortable stretch. As with all of yoga, if you feel any imbalances (e.g. the right side stretches more than the left) then try to train each siide equally; overtime, you will gain an increased range of motion if you practice this in a safe and consistent manner.