<commit_before>#include "test.h"

static_LST(lst3);
static_MEM(mem3, 1, sizeof(unsigned));

static unsigned sent = 0;
static unsigned received = 0;

static void proc1()
{
	void   * p;
	unsigned event;

 	event = lst_wait(lst3, &p);                  assert_success(event);
	        received = *(unsigned *)p;           assert(sent == received);
            mem_give(mem3, p);
	        tsk_stop();
}

static void proc2()
{
	void   * p;
	unsigned event;

 	event = mem_wait(mem3, &p);                  assert_success(event);
	        *(unsigned *)p = sent = rand();
	        lst_give(lst3, p);
	        tsk_stop();
}

static void test()
{
	unsigned event;
		                                         assert_dead(tsk1);
	        tsk_startFrom(tsk1, proc1);
		                                         assert_dead(tsk2);
	        tsk_startFrom(tsk2, proc2);
	event = tsk_join(tsk2);                      assert_success(event);
	event = tsk_join(tsk1);                      assert_success(event);
}

void test_memory_pool_3()
{
	int i;
	TEST_Notify();
	mem_bind(mem3);
	for (i = 0; i < PASS; i++)
		test();<commit_msg>Update test_memory_pool_3.c<commit_after>#include "test.h"

static_LST(lst3);
static_MEM(mem3, 1, sizeof(unsigned));

static unsigned sent = 0;
static unsigned received = 0;

static void proc1()
{
	void   * p;
	unsigned event;

 	event = lst_wait(lst3, &p);                  assert_success(event);
	        received = *(unsigned *)p;           assert(sent == received);
            mem_give(mem3, p);
	        tsk_stop();
}

static void proc2()
{
	void   * p;
	unsigned event;

 	event = mem_wait(mem3, &p);                  assert_success(event);
	        *(unsigned *)p = sent = rand();
	        lst_give(lst3, p);
	        tsk_stop();
}

static void test()
{
	unsigned event;
		                                         assert_dead(tsk1);
	        tsk_startFrom(tsk1, proc1);
		                                         assert_dead(tsk2);
	        tsk_startFrom(tsk2, proc2);
	event = tsk_join(tsk2);                      assert_success(event);
	event = tsk_join(tsk1);                      assert_success(event);
}

void test_memory_pool_3()
{
	TEST_Notify();
	mem_bind(mem3);
	TEST_Call();
{'fraction_non_alphanumeric': 0.12443233424159855, 'fraction_numerical': 0.019981834695731154, 'mean_word_length': 1.9530831099195711, 'pattern_counts': {'":': 0, '<': 4, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4543863', 'n_tokens_mistral': 766, 'n_tokens_neox': 713, 'n_words': 154}