<commit_before>#include <stdint.h>
#include <fcntl.h>
#include <unistd.h>
#include <poll.h>
#include <sys/socket.h>

#include <dynamic.h>

#include "reactor_user.h"
#include "reactor_desc.h"
#include "reactor_core.h"

static inline void reactor_desc_close_final(reactor_desc *desc)
{
  if (desc->state == REACTOR_DESC_CLOSE_WAIT && !desc->ref)
    {
      reactor_user_dispatch(&desc->user, REACTOR_DESC_CLOSE, NULL);
      desc->state = REACTOR_DESC_CLOSED;
    }
}

static inline void reactor_desc_hold(reactor_desc *desc)
{
  desc->ref ++;
}<commit_msg>Unify close wait patternt<commit_after>#include <stdint.h>
#include <fcntl.h>
#include <unistd.h>
#include <poll.h>
#include <sys/socket.h>

#include <dynamic.h>

#include "reactor_user.h"
#include "reactor_desc.h"
#include "reactor_core.h"

static inline void reactor_desc_close_final(reactor_desc *desc)
{
  if (desc->state == REACTOR_DESC_CLOSE_WAIT &&
      desc->ref == 0)
    {
      reactor_user_dispatch(&desc->user, REACTOR_DESC_CLOSE, NULL);
      desc->state = REACTOR_DESC_CLOSED;
    }
}

static inline void reactor_desc_hold(reactor_desc *desc)
{
  desc->ref ++;
}
{'fraction_non_alphanumeric': 0.1419753086419753, 'fraction_numerical': 0.0008818342151675485, 'mean_word_length': 4.911458333333333, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 25, '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': '6792354', 'n_tokens_mistral': 453, 'n_tokens_neox': 447, 'n_words': 80}