Sorry for giving a running example on the cycling thread but I guess the same principle applies.