Just asking what is the benefit of stopping it in this way (using an instance variable, and stopping it from the thread), once the variable is false, maybe can introduce some racing condition :? between the moment where the @finish is set to false, and the moment @finish is checked again on the monitoring thread. I ask myself if isn't better just to clean up here (kill the monitoring thread, and delete the @@hophandlers entry)