<commit_before>// content
package coffeenet

import (
	"math"
	"net"
	"sync/atomic"
)

type ContextFactory struct {
	//初始化上下文的方法
	initContextFunc func(content *Context)
	//获取ChannelId的种子
	idSeed int64
	//ChannelHandler组映射
	group map[int64]*Context
	//处理goroutine的个数限制
	workPool chan int64
	//是否顺序处理消息,默认false,即可以并发处理消息
	orderHandler bool
	handlerStat  *HanderStat
}

//初始化一个ContextFactory
func NewContextFactory(initContextFunc func(context *Context)) *ContextFactory {
	return &ContextFactory{initContextFunc, 0, make(map[int64]*Context), nil, false, nil}
}

//获取下一个Id
func (this *ContextFactory) nextId() int64 {
	atomic.CompareAndSwapInt64(&this.idSeed, math.MaxInt64, 0)
	return atomic.AddInt64(&this.idSeed, 1)
}

//关闭Factory ,将关闭下属所有的context
func (this *ContextFactory) Close() {<commit_msg>fix arm arch zero's point is nil bug<commit_after>// content
package coffeenet

import (
	"math"
	"net"
	"sync/atomic"
)

type ContextFactory struct {
	//初始化上下文的方法
	initContextFunc func(content *Context)
	//获取ChannelId的种子
	idSeed *int64
	//ChannelHandler组映射
	group map[int64]*Context
	//处理goroutine的个数限制
	workPool chan int64
	//是否顺序处理消息,默认false,即可以并发处理消息
	orderHandler bool
	handlerStat  *HanderStat
}

//初始化一个ContextFactory
func NewContextFactory(initContextFunc func(context *Context)) *ContextFactory {
	var idSeed int64 = 0
	return &ContextFactory{initContextFunc, &idSeed, make(map[int64]*Context), nil, false, nil}
}

//获取下一个Id
func (this *ContextFactory) nextId() int64 {
	atomic.CompareAndSwapInt64(this.idSeed, math.MaxInt64, 0)
	return atomic.AddInt64(this.idSeed, 1)
}

//关闭Factory ,将关闭下属所有的context
func (this *ContextFactory) Close() {
{'fraction_non_alphanumeric': 0.11070559610705596, 'fraction_numerical': 0.024330900243309004, 'mean_word_length': 5.686991869918699, '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': '6464760', 'n_tokens_mistral': 671, 'n_tokens_neox': 682, 'n_words': 133}