<commit_before>
import java.util.concurrent.CountDownLatch;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * 'Blast' a resource with many concurrent threads simultaneously, synchronized
 * to the same line of code.
 *
 * @author Jacob
 */
public class Blast {

	/* number of iterations to apply */
	private static final int ITERATIONS = 100;
	/* number of concurrent threads to use */
	private static final int THREADS = 10;

	public static void main(String[] args) throws InterruptedException {
		for (int iteration = 0; iteration < ITERATIONS; iteration++) {

			// latch to synchronize when all threads have initialized
			CountDownLatch threadsLatch = new CountDownLatch(THREADS);
			// latch to synchronize when
			CountDownLatch iterationLatch = new CountDownLatch(1);

			for (int thread = 0; thread < THREADS; thread++) {
				new Thread(() -> {

					// initialize thread resources...
					
					// register all threads
					threadsLatch.countDown();
					try {
						// wait for iteration to be synchronized
						iterationLatch.await();
					} catch (InterruptedException ex) {
						Logger.getLogger(Blast.class.getName()).log(Level.SEVERE, "Error awaiting iteration latch", ex);
						Thread.currentThread().interrupt();
					}

					// perform operation, which will be 'blasted' by many concurrent threads...
					// e.g. call SQL statement that is prone to deadlock during heavy usage, etc.
				}).start();
			}

			// wait for all threads to be synchronized
			threadsLatch.await();<commit_msg>finishing comment<commit_after>
import java.util.concurrent.CountDownLatch;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * 'Blast' a resource with many concurrent threads simultaneously, synchronized
 * to the same line of code.
 *
 * @author Jacob
 */
public class Blast {

	/* number of iterations to apply */
	private static final int ITERATIONS = 100;
	/* number of concurrent threads to use */
	private static final int THREADS = 10;

	public static void main(String[] args) throws InterruptedException {
		for (int iteration = 0; iteration < ITERATIONS; iteration++) {

			// latch to synchronize when all threads have initialized
			CountDownLatch threadsLatch = new CountDownLatch(THREADS);
			// latch to synchronize when the iteration is ready, and the 'blast' can begin
			CountDownLatch iterationLatch = new CountDownLatch(1);

			for (int thread = 0; thread < THREADS; thread++) {
				new Thread(() -> {

					// initialize thread resources...
					
					// register all threads
					threadsLatch.countDown();
					try {
						// wait for iteration to be synchronized
						iterationLatch.await();
					} catch (InterruptedException ex) {
						Logger.getLogger(Blast.class.getName()).log(Level.SEVERE, "Error awaiting iteration latch", ex);
						Thread.currentThread().interrupt();
					}

					// perform operation, which will be 'blasted' by many concurrent threads...
					// e.g. call SQL statement that is prone to deadlock during heavy usage, etc.
				}).start();
			}

			// wait for all threads to be synchronized
			threadsLatch.await();
{'fraction_non_alphanumeric': 0.10096153846153846, 'fraction_numerical': 0.005128205128205128, 'mean_word_length': 3.257844474761255, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '206146', 'n_tokens_mistral': 1038, 'n_tokens_neox': 832, 'n_words': 309}