improved thread locking debug messages