Just now I understand, what exactly happens. Nothing terrible, I am just confused that IDE doesn't warn (in other cases IDE is very talkative).
Sleeps. I also don't like a loop, but I don't see another way.
The app sends different parallel requests to web-server. Before each http-request the program checks access token, which lives a very short period.
I need to prevent executing of two "refreshtoken" in the same moment. In Windows I like to use CreateMutex. But what to do in B4A/B4I ?