Added thread locking for Log Queue