Inserting threads into ready list orderd by priority