<commit_before>/**
 * Copyright 2012 Netflix, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package backport.java.util.concurrent.atomic;

/*
 * Written by <NAME> with assistance from members of JCP JSR-166
 * Expert Group and released to the public domain, as explained at
 * http://creativecommons.org/publicdomain/zero/1.0/
 * 
 * From http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/ 
 */

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;

/**
 * One or more variables that together maintain an initially zero {@code long} sum. When updates (method {@link #add})
 * are contended across threads, the set of variables may grow dynamically to reduce contention. Method {@link #sum}
 * (or, equivalently, {@link #longValue}) returns the current total combined across the variables maintaining the sum.
 * 
 * <p> This class is usually preferable to {@link AtomicLong} when multiple threads update a common sum that is used for
 * purposes such as collecting statistics, not for fine-grained synchronization control. Under low update contention,
 * the two classes have similar characteristics. But under high contention, expected throughput of this class is
 * significantly higher, at the expense of higher space consumption.
 * 
 * <p> This class extends {@link Number}, but does <em>not</em> define methods such as {@code hashCode} and
 * {@code compareTo} because instances are expected to be mutated, and so are not useful as collection keys.
 * 
 * <p> <em>jsr166e note: This class is targeted to be placed in java.util.concurrent.atomic<em>
 * 
 * @since 1.8
 * @author <NAME>
 */
public class LongAdder extends Striped64 implements Serializable {
    private static final long serialVersionUID = 7249069246863182397L;

    /**
     * Version of plus for use in retryUpdate
     */
    @Override
    final long fn(long v, long x) {
        return v + x;
    }

    /**
     * Creates a new adder with initial sum of zero.
     */
    public LongAdder() {
    }

    /**<commit_msg>typo in javadoc<commit_after>/**
 * Copyright 2012 Netflix, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package backport.java.util.concurrent.atomic;

/*
 * Written by <NAME> with assistance from members of JCP JSR-166
 * Expert Group and released to the public domain, as explained at
 * http://creativecommons.org/publicdomain/zero/1.0/
 * 
 * From http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/jsr166e/ 
 */

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.concurrent.atomic.AtomicLong;

/**
 * One or more variables that together maintain an initially zero {@code long} sum. When updates (method {@link #add})
 * are contended across threads, the set of variables may grow dynamically to reduce contention. Method {@link #sum}
 * (or, equivalently, {@link #longValue}) returns the current total combined across the variables maintaining the sum.
 * 
 * <p> This class is usually preferable to {@link AtomicLong} when multiple threads update a common sum that is used for
 * purposes such as collecting statistics, not for fine-grained synchronization control. Under low update contention,
 * the two classes have similar characteristics. But under high contention, expected throughput of this class is
 * significantly higher, at the expense of higher space consumption.
 * 
 * <p> This class extends {@link Number}, but does <em>not</em> define methods such as {@code hashCode} and
 * {@code compareTo} because instances are expected to be mutated, and so are not useful as collection keys.
 * 
 * <p> <em>jsr166e note: This class is targeted to be placed in java.util.concurrent.atomic</em>
 * 
 * @since 1.8
 * @author <NAME>
 */
public class LongAdder extends Striped64 implements Serializable {
    private static final long serialVersionUID = 7249069246863182397L;

    /**
     * Version of plus for use in retryUpdate
     */
    @Override
    final long fn(long v, long x) {
        return v + x;
    }

    /**
     * Creates a new adder with initial sum of zero.
     */
    public LongAdder() {
    }

    /**
{'fraction_non_alphanumeric': 0.08656602331358686, 'fraction_numerical': 0.017198547678196063, 'mean_word_length': 3.664884135472371, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6889144', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1374, 'n_words': 634}