<commit_before>

#include <sys/time.h>                   // gettimeofday()

#include "logMsg/logMsg.h"              // LM_M()

#include "LockDebugger.h"               // LockDebugger
#include "au/Token.h"                   // au::Token
#include "au/Cronometer.h"              // au::Cronometer
#include "TokenTaker.h"				    // Own interface

//#define DEBUG_AU_TOKEN

NAMESPACE_BEGIN(au)

TokenTaker::TokenTaker( Token* _token  )
{
    token = _token;
    name = "Unknown";
    
    //LM_M(("New TokenTaker %s for token %s", name ,  token->name));
    au::Cronometer c;
    token->retain();
    double t = c.diffTime();
    if ( t > 0.1 )
        LM_W(("Token taker spent %.2f secs to lock mutex %s", token->name ));
}

TokenTaker::TokenTaker( Token* _token , const char* _name )
{
    token = _token;
    name = _name;
    
    //LM_M(("New TokenTaker %s for token %s", name ,  token->name));
    token->retain();
}

TokenTaker::~TokenTaker()
{<commit_msg>SAMSON-291 More control over token takers to see if they look main thread for a long time<commit_after>

#include <sys/time.h>                   // gettimeofday()

#include "logMsg/logMsg.h"              // LM_M()

#include "LockDebugger.h"               // LockDebugger
#include "au/Token.h"                   // au::Token
#include "au/Cronometer.h"              // au::Cronometer
#include "TokenTaker.h"				    // Own interface

//#define DEBUG_AU_TOKEN

NAMESPACE_BEGIN(au)

TokenTaker::TokenTaker( Token* _token  )
{
    token = _token;
    name = "Unknown";
    
    //LM_M(("New TokenTaker %s for token %s", name ,  token->name));
    au::Cronometer c;
    token->retain();
    double t = c.diffTime();
    if ( t > 0.1 )
        LM_W(("Token taker spent %.2f secs to lock mutex %s", t, token->name ));
}

TokenTaker::TokenTaker( Token* _token , const char* _name )
{
    token = _token;
    name = _name;
    
    //LM_M(("New TokenTaker %s for token %s", name ,  token->name));
    token->retain();
}

TokenTaker::~TokenTaker()
{
{'fraction_non_alphanumeric': 0.1543859649122807, 'fraction_numerical': 0.004511278195488722, 'mean_word_length': 2.299173553719008, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3477345', 'n_tokens_mistral': 722, 'n_tokens_neox': 710, 'n_words': 171}