<commit_before>/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   queue_count.c                                      :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: iwagner <<EMAIL>>                     +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2017/06/05 20:21:03 by iwagner           #+#    #+#             */
/*   Updated: 2017/06/05 20:21:07 by iwagner          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "dispatcher.h"

int	*queue_count(t_queue **queue)
{
	int x;

	if (*queue)
	{
		pthread_mutex_lock(&(*queue)->mutex);
		if((x = ((*queue)->count)))
		{
			pthread_mutex_unlock(&(*queue)->mutex);
			return(x);
		}
		else
		{
			pthread_mutex_unlock(&(*queue)->mutex);
			return(0);
		}
}<commit_msg>fixing the queue prototype<commit_after>/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   queue_count.c                                      :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: iwagner <<EMAIL>>        +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2017/06/05 20:21:03 by iwagner           #+#    #+#             */
/*   Updated: 2017/06/08 18:24:24 by cyildiri         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "dispatcher.h"

int	queue_count(t_queue **queue)
{
	int x;

	if (*queue)
	{
		pthread_mutex_lock(&(*queue)->mutex);
		if((x = ((*queue)->count)))
		{
			pthread_mutex_unlock(&(*queue)->mutex);
			return(x);
		}
		else
		{
			pthread_mutex_unlock(&(*queue)->mutex);
			return(0);
		}
}
{'fraction_non_alphanumeric': 0.28612836438923395, 'fraction_numerical': 0.02401656314699793, 'mean_word_length': 1.0, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 31, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4651142', 'n_tokens_mistral': 695, 'n_tokens_neox': 594, 'n_words': 69}