File: priorities.pml

package info (click to toggle)
spin 6.4.5%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,636 kB
  • ctags: 2,878
  • sloc: ansic: 40,035; yacc: 996; makefile: 37; sh: 5
file content (22 lines) | stat: -rw-r--r-- 292 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* test execution priorities
   run this as:
	spin -p -g priorities
   requires Spin Version 2.5 or later
*/

int a[5];

proctype A()
{
	do
	:: printf("%d\n", _pid); a[_pid]++
	od
}

init {
	atomic {
		run A() priority 1;
		run A() priority 2;
		run A() priority 3;
		run A() priority 4;
}	}