<commit_before>/* $Id$ */

#ifndef _PFL_THREAD_H_
#define _PFL_THREAD_H_

#include <sys/types.h>

#include <pthread.h>

#include "psc_ds/list.h"
#include "psc_ds/lockedlist.h"
#include "psc_util/lock.h"
#include "psc_util/log.h"
#include "psc_util/waitq.h"

#define PSC_THRNAME_MAX	16	/* must be 8-byte aligned */

struct psc_thread {
	struct psclist_head	   pscthr_lentry;		/* list management */
	psc_spinlock_t		   pscthr_lock;			/* for mutex */
	pthread_t		   pscthr_pthread;		/* pthread_self() */
	pid_t			   pscthr_thrid;		/* gettid(2) */

	void			*(*pscthr_startf)(void *);	/* thread main */
	void			 (*pscthr_dtor)(void *);	/* custom destructor */

	int			   pscthr_flags;		/* operational flags */
	int			   pscthr_type;			/* app-specific type */
	char			   pscthr_name[PSC_THRNAME_MAX];/* human readable name */
	int			  *pscthr_loglevels;		/* logging granularity */
	void			  *pscthr_private;		/* app-specific data */
	struct psc_waitq	   pscthr_waitq;		/* for init, at least */

	/* only used for thread initialization */<commit_msg>bump PSC_THRNAME_MAX from 16 to 32 to support things like "mzconnthr-172.16.17.32@tcp10".  this has a number of unfortunate implications, such as uglifying some control displays, but i'm working on that...<commit_after>/* $Id$ */

#ifndef _PFL_THREAD_H_
#define _PFL_THREAD_H_

#include <sys/types.h>

#include <pthread.h>

#include "psc_ds/list.h"
#include "psc_ds/lockedlist.h"
#include "psc_util/lock.h"
#include "psc_util/log.h"
#include "psc_util/waitq.h"

#define PSC_THRNAME_MAX	32	/* must be 8-byte aligned */

struct psc_thread {
	struct psclist_head	   pscthr_lentry;		/* list management */
	psc_spinlock_t		   pscthr_lock;			/* for mutex */
	pthread_t		   pscthr_pthread;		/* pthread_self() */
	pid_t			   pscthr_thrid;		/* gettid(2) */

#if 0
	/*
	 * XXX: If we modify fuse to invoke an application callback to
	 * create a new thread, we can utilize this new field to track
	 * threads by spawn index for use in gdb.
	 */
	int			   pscthr_index;		/* spawn timeline */
#endif

	void			*(*pscthr_startf)(void *);	/* thread main */
	void			 (*pscthr_dtor)(void *);	/* custom destructor */

	int			   pscthr_flags;		/* operational flags */
	int			   pscthr_type;			/* app-specific type */
	char			   pscthr_name[PSC_THRNAME_MAX];/* human readable name */
	int			  *pscthr_loglevels;		/* logging granularity */
	void			  *pscthr_private;		/* app-specific data */
	struct psc_waitq	   pscthr_waitq;		/* for init, at least */

	/* only used for thread initialization */
{'fraction_non_alphanumeric': 0.12351072279586973, 'fraction_numerical': 0.009531374106433678, 'mean_word_length': 3.291311754684838, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '6803430', 'n_tokens_mistral': 1064, 'n_tokens_neox': 981, 'n_words': 236}