apps/examples/pwfb/pwfb_main.c: Temporarily work around a race condition by adding a delay.

This commit is contained in:
Gregory Nutt 2019-03-16 15:54:08 -06:00
parent 9cd5d5c9ac
commit 51befb3fa7

View file

@ -396,6 +396,17 @@ static bool pwfb_configure_window(FAR struct pwfb_state_s *st, int wndx,
goto errout_with_hwnd;
}
/* There is a race condition which we resole by simply waiting a bit here:
* In order for the size and position to take effect, a command is sent to
* server which responds with an event. So we need to synchronize at this
* point, or the following fill will fail.
*
* REVISIT: Here a dumb wait is used. It be better to have a firm
* handshake to when the new size and position are in effect.
*/
usleep(500 * 1000);
/* Create a bounding box. This is actually too large because it does not
* account for the boarder widths. However, NX should clip the fill to
* stay within the frame.