Thanks Julien.
I have spent a bit more time to simulate the X Server lock, below is the sequence diagram of locking X Server, drawing on Canvas and unlocking X Server
.
Do you think that the X Server is exclusively locked during the "lock surface" phase?
The reason is the APP2 doesn't exit with above simulation of taking more than 10 seconds to draw on the Canvas.
Moreover, I'll try to learn from the third-party guy to ensure that I can understand their implementation further.