Added some more verbose info. Moved lock/unlock from thread loop when stopping.