Lock counter



<!---
@huboard:{"order":115.125,"milestone_order":136.5,"custom_state":""}
-->

I would be tempted to move this out and up to the time_matched_obs_thread level. Then process_matched_obs is called with a good set and all the lock counting logic is in one place.