Add each rule in the specified ruleSet to the set of (unique) rules maintained by this object. Return the number of rules added. The behavior is undefined unless a lock is not held by this thread on the mutex returned by rulesetMutex. Note that each rule having the same value as an existing rule will be ignored.