<commit_before>var a = 0;
var b = 0;
var c = 0;
var d = 0;

fun jam_records1 () {
  while (0==a) {   // wait on thread last statement in cobegin
    b = 1;
  }
}

fun jam_records2 () {
  while (0==b) {   // wait on thread 1
    c = 1;
  }
}

fun jam_records3 () {
  while (0==c) {   // wait on thread 2
    d = 1;
  }
}

cobegin {
  jam_records3();
  jam_records2();
  jam_records1();
  a = 1;
}

write ("d is ");
writeln (d);
<commit_msg>Removed a race condition that can cause deadlock.<commit_after>var a = 0;
var b = 0;
var c = 0;
var d = 0;

fun jam_records1 () {
  while (0==a) {;}   // wait on thread last statement in cobegin
  b = 1;
}

fun jam_records2 () {
  while (0==b) {;}   // wait on thread 1
  c = 1;
}

fun jam_records3 () {
  while (0==c) {;}   // wait on thread 2
  d = 1;
}

cobegin {
  jam_records3();
  jam_records2();
  jam_records1();
  a = 1;
}

write ("d is ");
writeln (d);

{'fraction_non_alphanumeric': 0.16851441241685144, 'fraction_numerical': 0.04212860310421286, 'mean_word_length': 2.446564885496183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7236518', 'n_tokens_mistral': 402, 'n_tokens_neox': 381, 'n_words': 119}