Effects of poloidal and parallel flows on resistive wall mode instability in toroidally rotating plasmas