Discussion: testAndSet is not sufficing bounded waiting

for example: If we have two processes say p1 and p2 then if process p1 checked the lock first, gets it after running testAndSet once, then p2 came in and go for testAndSet get false and started waiting. Then, P1 switched back and it completed its critical section and set it false and done its remainder section then went back again to check for critical section find it false (because it had just made it false), reenter the critical section. Now if p2 is switched back it will get false from testAndSet, thus, p2 did not get to run in the critical section, maybe ever.
What you think can be a possible solution to make it Bounded waiting?