Purge() + better Resume() + more tests.

Why do you pass the lock as a parameter to member function?