byte ok;

c_state "Entry head"	"Global"
c_state "Entry sample[2]" "Local rtl_put"

active [2] proctype rtl_put()		/* 2 processes */
{	int i = 0;
	c_code {			/* initialization */
		rtl_init(&now.head);
		Prtl_put->sample[0].value = 1;
		Prtl_put->sample[1].value = 2;
	};
	ok++;
again:
	c_code {	/* set params for pseudo-call */
		Prtl_put->q = &now.head;
		Prtl_put->new = &(Prtl_put->sample[Prtl_put->i]);
	};

#include "_modex_rtl_put.spn"

	if
	:: i < 1 -> i++; goto again
	:: else	/* terminate */
	fi
}
active proctype rtl_get()
{	byte val1, val2;

	(ok == 2);	/* await initialization */
again:
	c_code {	/* set param for pseudo-call */
		Prtl_get->q = &now.head;
	};

#include "_modex_rtl_get.spn"

	if
	:: c_expr { Prtl_get->next == nil } -> goto again
	:: else
	fi;
	if
	:: c_expr { Prtl_get->next->value == Prtl_get->val1 + 1} ->
		c_code { Prtl_get->val1 = Prtl_get->next->value; }
	:: c_expr { Prtl_get->next->value == Prtl_get->val2 + 1} ->
		c_code { Prtl_get->val2 = Prtl_get->next->value; }
	:: else ->
		assert(1+1!=2)
	fi;
	goto again
}
