summaryrefslogtreecommitdiff
path: root/test/smp/regression/threadx_smp_random_resume_suspend_test.c
blob: c4704da44428c8b5c9732a66cf198b7ce6223ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
/***************************************************************************/
/* Copyright (c) 2024 Microsoft Corporation                                */
/* Copyright (c) 2026 Eclipse ThreadX contributors                         */
/*                                                                         */
/* This program and the accompanying materials are made available under    */
/* the terms of the MIT License which is available at                      */
/* https://opensource.org/licenses/MIT.                                    */
/*                                                                         */
/* SPDX-License-Identifier: MIT                                            */
/***************************************************************************/

/* Define the ThreadX SMP random resume/suspend test.  */

#include   <stdio.h>
#include   "tx_api.h"

//#define MAX_PASSES      50000000
//#define MAX_PASSES      50000
#define MAX_PASSES      500


/* Define the ThreadX object control blocks... Must have 256 priority levels... and assumes 4 cores.  */

static TX_THREAD               thread_0;
static TX_THREAD               thread_1;
static TX_THREAD               thread_2;
static TX_THREAD               thread_3;
static TX_THREAD               thread_4;
static TX_THREAD               thread_5;
static TX_THREAD               thread_6;
static TX_THREAD               thread_7;
static TX_THREAD               thread_8;
static TX_THREAD               thread_9;
static TX_THREAD               thread_10;
static TX_THREAD               thread_11;
static TX_THREAD               thread_12;
static TX_THREAD               thread_13;
static TX_THREAD               thread_14;
static TX_THREAD               thread_15;
static TX_THREAD               thread_16;
static TX_THREAD               thread_17;
static TX_THREAD               thread_18;
static TX_THREAD               thread_19;
static TX_THREAD               thread_20;
static TX_THREAD               thread_21;
static TX_THREAD               thread_22;
static TX_THREAD               thread_23;
static TX_THREAD               thread_24;
static TX_THREAD               thread_25;
static TX_THREAD               thread_26;
static TX_THREAD               thread_27;
static TX_THREAD               thread_28;
static TX_THREAD               thread_29;
static TX_THREAD               thread_30;
static TX_THREAD               thread_31;
static TX_THREAD               thread_32;
static TX_THREAD               thread_33;
static TX_THREAD               thread_34;
static TX_THREAD               thread_35;
static TX_THREAD               thread_36;
static TX_THREAD               thread_37;
static TX_THREAD               thread_38;
static TX_THREAD               thread_39;
static TX_THREAD               thread_40;
static TX_THREAD               thread_41;
static TX_THREAD               thread_42;
static TX_THREAD               thread_43;
static TX_THREAD               thread_44;
static TX_THREAD               thread_45;
static TX_THREAD               thread_46;
static TX_THREAD               thread_47;
static TX_THREAD               thread_48;
static TX_THREAD               thread_49;
static TX_THREAD               thread_50;
static TX_THREAD               thread_51;
static TX_THREAD               thread_52;
static TX_THREAD               thread_53;
static TX_THREAD               thread_54;
static TX_THREAD               thread_55;
static TX_THREAD               thread_56;
static TX_THREAD               thread_57;
static TX_THREAD               thread_58;
static TX_THREAD               thread_59;
static TX_THREAD               thread_60;
static TX_THREAD               thread_61;
static TX_THREAD               thread_62;
static TX_THREAD               thread_63;
static TX_THREAD               thread_64;
static TX_THREAD               thread_65;
static TX_THREAD               thread_66;
static TX_THREAD               thread_67;
static TX_THREAD               thread_68;
static TX_THREAD               thread_69;
static TX_THREAD               thread_70;
static TX_THREAD               thread_71;
static TX_THREAD               thread_72;
static TX_THREAD               thread_73;
static TX_THREAD               thread_74;
static TX_THREAD               thread_75;
static TX_THREAD               thread_76;
static TX_THREAD               thread_77;
static TX_THREAD               thread_78;
static TX_THREAD               thread_79;
static TX_THREAD               thread_80;
static TX_THREAD               thread_81;
static TX_THREAD               thread_82;
static TX_THREAD               thread_83;
static TX_THREAD               thread_84;
static TX_THREAD               thread_85;
static TX_THREAD               thread_86;
static TX_THREAD               thread_87;
static TX_THREAD               thread_88;
static TX_THREAD               thread_89;
static TX_THREAD               thread_90;
static TX_THREAD               thread_91;
static TX_THREAD               thread_92;
static TX_THREAD               thread_93;
static TX_THREAD               thread_94;
static TX_THREAD               thread_95;
static TX_THREAD               thread_96;
static TX_THREAD               thread_97;
static TX_THREAD               thread_98;
static TX_THREAD               thread_99;
static TX_THREAD               thread_100;
static TX_THREAD               thread_101;
static TX_THREAD               thread_102;
static TX_THREAD               thread_103;
static TX_THREAD               thread_104;
static TX_THREAD               thread_105;
static TX_THREAD               thread_106;
static TX_THREAD               thread_107;
static TX_THREAD               thread_108;
static TX_THREAD               thread_109;
static TX_THREAD               thread_110;
static TX_THREAD               thread_111;
static TX_THREAD               thread_112;
static TX_THREAD               thread_113;
static TX_THREAD               thread_114;
static TX_THREAD               thread_115;
static TX_THREAD               thread_116;
static TX_THREAD               thread_117;
static TX_THREAD               thread_118;
static TX_THREAD               thread_119;
static TX_THREAD               thread_120;
static TX_THREAD               thread_121;
static TX_THREAD               thread_122;
static TX_THREAD               thread_123;
static TX_THREAD               thread_124;
static TX_THREAD               thread_125;
static TX_THREAD               thread_126;
static TX_THREAD               thread_127;
static TX_THREAD               thread_128;
static TX_THREAD               thread_129;
static TX_THREAD               thread_130;
static TX_THREAD               thread_131;
static TX_THREAD               thread_132;
static TX_THREAD               thread_133;
static TX_THREAD               thread_134;
static TX_THREAD               thread_135;
static TX_THREAD               thread_136;
static TX_THREAD               thread_137;
static TX_THREAD               thread_138;
static TX_THREAD               thread_139;
static TX_THREAD               thread_140;
static TX_THREAD               thread_141;
static TX_THREAD               thread_142;
static TX_THREAD               thread_143;
static TX_THREAD               thread_144;
static TX_THREAD               thread_145;
static TX_THREAD               thread_146;
static TX_THREAD               thread_147;
static TX_THREAD               thread_148;
static TX_THREAD               thread_149;
static TX_THREAD               thread_150;
static TX_THREAD               thread_151;
static TX_THREAD               thread_152;
static TX_THREAD               thread_153;
static TX_THREAD               thread_154;
static TX_THREAD               thread_155;
static TX_THREAD               thread_156;
static TX_THREAD               thread_157;
static TX_THREAD               thread_158;
static TX_THREAD               thread_159;
static TX_THREAD               thread_160;
static TX_THREAD               thread_161;
static TX_THREAD               thread_162;
static TX_THREAD               thread_163;
static TX_THREAD               thread_164;
static TX_THREAD               thread_165;
static TX_THREAD               thread_166;
static TX_THREAD               thread_167;
static TX_THREAD               thread_168;
static TX_THREAD               thread_169;
static TX_THREAD               thread_170;
static TX_THREAD               thread_171;
static TX_THREAD               thread_172;
static TX_THREAD               thread_173;
static TX_THREAD               thread_174;
static TX_THREAD               thread_175;
static TX_THREAD               thread_176;
static TX_THREAD               thread_177;
static TX_THREAD               thread_178;
static TX_THREAD               thread_179;
static TX_THREAD               thread_180;
static TX_THREAD               thread_181;
static TX_THREAD               thread_182;
static TX_THREAD               thread_183;
static TX_THREAD               thread_184;
static TX_THREAD               thread_185;
static TX_THREAD               thread_186;
static TX_THREAD               thread_187;
static TX_THREAD               thread_188;
static TX_THREAD               thread_189;
static TX_THREAD               thread_190;
static TX_THREAD               thread_191;
static TX_THREAD               thread_192;
static TX_THREAD               thread_193;
static TX_THREAD               thread_194;
static TX_THREAD               thread_195;
static TX_THREAD               thread_196;
static TX_THREAD               thread_197;
static TX_THREAD               thread_198;
static TX_THREAD               thread_199;
static TX_THREAD               thread_200;
static TX_THREAD               thread_201;
static TX_THREAD               thread_202;
static TX_THREAD               thread_203;
static TX_THREAD               thread_204;
static TX_THREAD               thread_205;
static TX_THREAD               thread_206;
static TX_THREAD               thread_207;
static TX_THREAD               thread_208;
static TX_THREAD               thread_209;
static TX_THREAD               thread_210;
static TX_THREAD               thread_211;
static TX_THREAD               thread_212;
static TX_THREAD               thread_213;
static TX_THREAD               thread_214;
static TX_THREAD               thread_215;
static TX_THREAD               thread_216;
static TX_THREAD               thread_217;
static TX_THREAD               thread_218;
static TX_THREAD               thread_219;
static TX_THREAD               thread_220;
static TX_THREAD               thread_221;
static TX_THREAD               thread_222;
static TX_THREAD               thread_223;
static TX_THREAD               thread_224;
static TX_THREAD               thread_225;
static TX_THREAD               thread_226;
static TX_THREAD               thread_227;
static TX_THREAD               thread_228;
static TX_THREAD               thread_229;
static TX_THREAD               thread_230;
static TX_THREAD               thread_231;
static TX_THREAD               thread_232;
static TX_THREAD               thread_233;
static TX_THREAD               thread_234;
static TX_THREAD               thread_235;
static TX_THREAD               thread_236;
static TX_THREAD               thread_237;
static TX_THREAD               thread_238;
static TX_THREAD               thread_239;
static TX_THREAD               thread_240;
static TX_THREAD               thread_241;
static TX_THREAD               thread_242;
static TX_THREAD               thread_243;
static TX_THREAD               thread_244;
static TX_THREAD               thread_245;
static TX_THREAD               thread_246;
static TX_THREAD               thread_247;
static TX_THREAD               thread_248;
static TX_THREAD               thread_249;
static TX_THREAD               thread_250;
static TX_THREAD               thread_251;
static TX_THREAD               thread_252;
static TX_THREAD               thread_253;
static TX_THREAD               thread_254;
static TX_THREAD               thread_255;

static TX_THREAD               thread_0_1;
static TX_THREAD               thread_1_1;
static TX_THREAD               thread_2_1;
static TX_THREAD               thread_3_1;
static TX_THREAD               thread_4_1;
static TX_THREAD               thread_5_1;
static TX_THREAD               thread_6_1;
static TX_THREAD               thread_7_1;
static TX_THREAD               thread_8_1;
static TX_THREAD               thread_9_1;
static TX_THREAD               thread_10_1;
static TX_THREAD               thread_11_1;
static TX_THREAD               thread_12_1;
static TX_THREAD               thread_13_1;
static TX_THREAD               thread_14_1;
static TX_THREAD               thread_15_1;
static TX_THREAD               thread_16_1;
static TX_THREAD               thread_17_1;
static TX_THREAD               thread_18_1;
static TX_THREAD               thread_19_1;
static TX_THREAD               thread_20_1;
static TX_THREAD               thread_21_1;
static TX_THREAD               thread_22_1;
static TX_THREAD               thread_23_1;
static TX_THREAD               thread_24_1;
static TX_THREAD               thread_25_1;
static TX_THREAD               thread_26_1;
static TX_THREAD               thread_27_1;
static TX_THREAD               thread_28_1;
static TX_THREAD               thread_29_1;
static TX_THREAD               thread_30_1;
static TX_THREAD               thread_31_1;
static TX_THREAD               thread_32_1;
static TX_THREAD               thread_33_1;
static TX_THREAD               thread_34_1;
static TX_THREAD               thread_35_1;
static TX_THREAD               thread_36_1;
static TX_THREAD               thread_37_1;
static TX_THREAD               thread_38_1;
static TX_THREAD               thread_39_1;
static TX_THREAD               thread_40_1;
static TX_THREAD               thread_41_1;
static TX_THREAD               thread_42_1;
static TX_THREAD               thread_43_1;
static TX_THREAD               thread_44_1;
static TX_THREAD               thread_45_1;
static TX_THREAD               thread_46_1;
static TX_THREAD               thread_47_1;
static TX_THREAD               thread_48_1;
static TX_THREAD               thread_49_1;
static TX_THREAD               thread_50_1;
static TX_THREAD               thread_51_1;
static TX_THREAD               thread_52_1;
static TX_THREAD               thread_53_1;
static TX_THREAD               thread_54_1;
static TX_THREAD               thread_55_1;
static TX_THREAD               thread_56_1;
static TX_THREAD               thread_57_1;
static TX_THREAD               thread_58_1;
static TX_THREAD               thread_59_1;
static TX_THREAD               thread_60_1;
static TX_THREAD               thread_61_1;
static TX_THREAD               thread_62_1;
static TX_THREAD               thread_63_1;
static TX_THREAD               thread_64_1;
static TX_THREAD               thread_65_1;
static TX_THREAD               thread_66_1;
static TX_THREAD               thread_67_1;
static TX_THREAD               thread_68_1;
static TX_THREAD               thread_69_1;
static TX_THREAD               thread_70_1;
static TX_THREAD               thread_71_1;
static TX_THREAD               thread_72_1;
static TX_THREAD               thread_73_1;
static TX_THREAD               thread_74_1;
static TX_THREAD               thread_75_1;
static TX_THREAD               thread_76_1;
static TX_THREAD               thread_77_1;
static TX_THREAD               thread_78_1;
static TX_THREAD               thread_79_1;
static TX_THREAD               thread_80_1;
static TX_THREAD               thread_81_1;
static TX_THREAD               thread_82_1;
static TX_THREAD               thread_83_1;
static TX_THREAD               thread_84_1;
static TX_THREAD               thread_85_1;
static TX_THREAD               thread_86_1;
static TX_THREAD               thread_87_1;
static TX_THREAD               thread_88_1;
static TX_THREAD               thread_89_1;
static TX_THREAD               thread_90_1;
static TX_THREAD               thread_91_1;
static TX_THREAD               thread_92_1;
static TX_THREAD               thread_93_1;
static TX_THREAD               thread_94_1;
static TX_THREAD               thread_95_1;
static TX_THREAD               thread_96_1;
static TX_THREAD               thread_97_1;
static TX_THREAD               thread_98_1;
static TX_THREAD               thread_99_1;
static TX_THREAD               thread_100_1;
static TX_THREAD               thread_101_1;
static TX_THREAD               thread_102_1;
static TX_THREAD               thread_103_1;
static TX_THREAD               thread_104_1;
static TX_THREAD               thread_105_1;
static TX_THREAD               thread_106_1;
static TX_THREAD               thread_107_1;
static TX_THREAD               thread_108_1;
static TX_THREAD               thread_109_1;
static TX_THREAD               thread_110_1;
static TX_THREAD               thread_111_1;
static TX_THREAD               thread_112_1;
static TX_THREAD               thread_113_1;
static TX_THREAD               thread_114_1;
static TX_THREAD               thread_115_1;
static TX_THREAD               thread_116_1;
static TX_THREAD               thread_117_1;
static TX_THREAD               thread_118_1;
static TX_THREAD               thread_119_1;
static TX_THREAD               thread_120_1;
static TX_THREAD               thread_121_1;
static TX_THREAD               thread_122_1;
static TX_THREAD               thread_123_1;
static TX_THREAD               thread_124_1;
static TX_THREAD               thread_125_1;
static TX_THREAD               thread_126_1;
static TX_THREAD               thread_127_1;
static TX_THREAD               thread_128_1;
static TX_THREAD               thread_129_1;
static TX_THREAD               thread_130_1;
static TX_THREAD               thread_131_1;
static TX_THREAD               thread_132_1;
static TX_THREAD               thread_133_1;
static TX_THREAD               thread_134_1;
static TX_THREAD               thread_135_1;
static TX_THREAD               thread_136_1;
static TX_THREAD               thread_137_1;
static TX_THREAD               thread_138_1;
static TX_THREAD               thread_139_1;
static TX_THREAD               thread_140_1;
static TX_THREAD               thread_141_1;
static TX_THREAD               thread_142_1;
static TX_THREAD               thread_143_1;
static TX_THREAD               thread_144_1;
static TX_THREAD               thread_145_1;
static TX_THREAD               thread_146_1;
static TX_THREAD               thread_147_1;
static TX_THREAD               thread_148_1;
static TX_THREAD               thread_149_1;
static TX_THREAD               thread_150_1;
static TX_THREAD               thread_151_1;
static TX_THREAD               thread_152_1;
static TX_THREAD               thread_153_1;
static TX_THREAD               thread_154_1;
static TX_THREAD               thread_155_1;
static TX_THREAD               thread_156_1;
static TX_THREAD               thread_157_1;
static TX_THREAD               thread_158_1;
static TX_THREAD               thread_159_1;
static TX_THREAD               thread_160_1;
static TX_THREAD               thread_161_1;
static TX_THREAD               thread_162_1;
static TX_THREAD               thread_163_1;
static TX_THREAD               thread_164_1;
static TX_THREAD               thread_165_1;
static TX_THREAD               thread_166_1;
static TX_THREAD               thread_167_1;
static TX_THREAD               thread_168_1;
static TX_THREAD               thread_169_1;
static TX_THREAD               thread_170_1;
static TX_THREAD               thread_171_1;
static TX_THREAD               thread_172_1;
static TX_THREAD               thread_173_1;
static TX_THREAD               thread_174_1;
static TX_THREAD               thread_175_1;
static TX_THREAD               thread_176_1;
static TX_THREAD               thread_177_1;
static TX_THREAD               thread_178_1;
static TX_THREAD               thread_179_1;
static TX_THREAD               thread_180_1;
static TX_THREAD               thread_181_1;
static TX_THREAD               thread_182_1;
static TX_THREAD               thread_183_1;
static TX_THREAD               thread_184_1;
static TX_THREAD               thread_185_1;
static TX_THREAD               thread_186_1;
static TX_THREAD               thread_187_1;
static TX_THREAD               thread_188_1;
static TX_THREAD               thread_189_1;
static TX_THREAD               thread_190_1;
static TX_THREAD               thread_191_1;
static TX_THREAD               thread_192_1;
static TX_THREAD               thread_193_1;
static TX_THREAD               thread_194_1;
static TX_THREAD               thread_195_1;
static TX_THREAD               thread_196_1;
static TX_THREAD               thread_197_1;
static TX_THREAD               thread_198_1;
static TX_THREAD               thread_199_1;
static TX_THREAD               thread_200_1;
static TX_THREAD               thread_201_1;
static TX_THREAD               thread_202_1;
static TX_THREAD               thread_203_1;
static TX_THREAD               thread_204_1;
static TX_THREAD               thread_205_1;
static TX_THREAD               thread_206_1;
static TX_THREAD               thread_207_1;
static TX_THREAD               thread_208_1;
static TX_THREAD               thread_209_1;
static TX_THREAD               thread_210_1;
static TX_THREAD               thread_211_1;
static TX_THREAD               thread_212_1;
static TX_THREAD               thread_213_1;
static TX_THREAD               thread_214_1;
static TX_THREAD               thread_215_1;
static TX_THREAD               thread_216_1;
static TX_THREAD               thread_217_1;
static TX_THREAD               thread_218_1;
static TX_THREAD               thread_219_1;
static TX_THREAD               thread_220_1;
static TX_THREAD               thread_221_1;
static TX_THREAD               thread_222_1;
static TX_THREAD               thread_223_1;
static TX_THREAD               thread_224_1;
static TX_THREAD               thread_225_1;
static TX_THREAD               thread_226_1;
static TX_THREAD               thread_227_1;
static TX_THREAD               thread_228_1;
static TX_THREAD               thread_229_1;
static TX_THREAD               thread_230_1;
static TX_THREAD               thread_231_1;
static TX_THREAD               thread_232_1;
static TX_THREAD               thread_233_1;
static TX_THREAD               thread_234_1;
static TX_THREAD               thread_235_1;
static TX_THREAD               thread_236_1;
static TX_THREAD               thread_237_1;
static TX_THREAD               thread_238_1;
static TX_THREAD               thread_239_1;
static TX_THREAD               thread_240_1;
static TX_THREAD               thread_241_1;
static TX_THREAD               thread_242_1;
static TX_THREAD               thread_243_1;
static TX_THREAD               thread_244_1;
static TX_THREAD               thread_245_1;
static TX_THREAD               thread_246_1;
static TX_THREAD               thread_247_1;
static TX_THREAD               thread_248_1;
static TX_THREAD               thread_249_1;
static TX_THREAD               thread_250_1;
static TX_THREAD               thread_251_1;
static TX_THREAD               thread_252_1;
static TX_THREAD               thread_253_1;
static TX_THREAD               thread_254_1;
static TX_THREAD               thread_255_1;

static TX_THREAD               thread_0_2;
static TX_THREAD               thread_1_2;
static TX_THREAD               thread_2_2;
static TX_THREAD               thread_3_2;
static TX_THREAD               thread_4_2;
static TX_THREAD               thread_5_2;
static TX_THREAD               thread_6_2;
static TX_THREAD               thread_7_2;
static TX_THREAD               thread_8_2;
static TX_THREAD               thread_9_2;
static TX_THREAD               thread_10_2;
static TX_THREAD               thread_11_2;
static TX_THREAD               thread_12_2;
static TX_THREAD               thread_13_2;
static TX_THREAD               thread_14_2;
static TX_THREAD               thread_15_2;
static TX_THREAD               thread_16_2;
static TX_THREAD               thread_17_2;
static TX_THREAD               thread_18_2;
static TX_THREAD               thread_19_2;
static TX_THREAD               thread_20_2;
static TX_THREAD               thread_21_2;
static TX_THREAD               thread_22_2;
static TX_THREAD               thread_23_2;
static TX_THREAD               thread_24_2;
static TX_THREAD               thread_25_2;
static TX_THREAD               thread_26_2;
static TX_THREAD               thread_27_2;
static TX_THREAD               thread_28_2;
static TX_THREAD               thread_29_2;
static TX_THREAD               thread_30_2;
static TX_THREAD               thread_31_2;
static TX_THREAD               thread_32_2;
static TX_THREAD               thread_33_2;
static TX_THREAD               thread_34_2;
static TX_THREAD               thread_35_2;
static TX_THREAD               thread_36_2;
static TX_THREAD               thread_37_2;
static TX_THREAD               thread_38_2;
static TX_THREAD               thread_39_2;
static TX_THREAD               thread_40_2;
static TX_THREAD               thread_41_2;
static TX_THREAD               thread_42_2;
static TX_THREAD               thread_43_2;
static TX_THREAD               thread_44_2;
static TX_THREAD               thread_45_2;
static TX_THREAD               thread_46_2;
static TX_THREAD               thread_47_2;
static TX_THREAD               thread_48_2;
static TX_THREAD               thread_49_2;
static TX_THREAD               thread_50_2;
static TX_THREAD               thread_51_2;
static TX_THREAD               thread_52_2;
static TX_THREAD               thread_53_2;
static TX_THREAD               thread_54_2;
static TX_THREAD               thread_55_2;
static TX_THREAD               thread_56_2;
static TX_THREAD               thread_57_2;
static TX_THREAD               thread_58_2;
static TX_THREAD               thread_59_2;
static TX_THREAD               thread_60_2;
static TX_THREAD               thread_61_2;
static TX_THREAD               thread_62_2;
static TX_THREAD               thread_63_2;
static TX_THREAD               thread_64_2;
static TX_THREAD               thread_65_2;
static TX_THREAD               thread_66_2;
static TX_THREAD               thread_67_2;
static TX_THREAD               thread_68_2;
static TX_THREAD               thread_69_2;
static TX_THREAD               thread_70_2;
static TX_THREAD               thread_71_2;
static TX_THREAD               thread_72_2;
static TX_THREAD               thread_73_2;
static TX_THREAD               thread_74_2;
static TX_THREAD               thread_75_2;
static TX_THREAD               thread_76_2;
static TX_THREAD               thread_77_2;
static TX_THREAD               thread_78_2;
static TX_THREAD               thread_79_2;
static TX_THREAD               thread_80_2;
static TX_THREAD               thread_81_2;
static TX_THREAD               thread_82_2;
static TX_THREAD               thread_83_2;
static TX_THREAD               thread_84_2;
static TX_THREAD               thread_85_2;
static TX_THREAD               thread_86_2;
static TX_THREAD               thread_87_2;
static TX_THREAD               thread_88_2;
static TX_THREAD               thread_89_2;
static TX_THREAD               thread_90_2;
static TX_THREAD               thread_91_2;
static TX_THREAD               thread_92_2;
static TX_THREAD               thread_93_2;
static TX_THREAD               thread_94_2;
static TX_THREAD               thread_95_2;
static TX_THREAD               thread_96_2;
static TX_THREAD               thread_97_2;
static TX_THREAD               thread_98_2;
static TX_THREAD               thread_99_2;
static TX_THREAD               thread_100_2;
static TX_THREAD               thread_101_2;
static TX_THREAD               thread_102_2;
static TX_THREAD               thread_103_2;
static TX_THREAD               thread_104_2;
static TX_THREAD               thread_105_2;
static TX_THREAD               thread_106_2;
static TX_THREAD               thread_107_2;
static TX_THREAD               thread_108_2;
static TX_THREAD               thread_109_2;
static TX_THREAD               thread_110_2;
static TX_THREAD               thread_111_2;
static TX_THREAD               thread_112_2;
static TX_THREAD               thread_113_2;
static TX_THREAD               thread_114_2;
static TX_THREAD               thread_115_2;
static TX_THREAD               thread_116_2;
static TX_THREAD               thread_117_2;
static TX_THREAD               thread_118_2;
static TX_THREAD               thread_119_2;
static TX_THREAD               thread_120_2;
static TX_THREAD               thread_121_2;
static TX_THREAD               thread_122_2;
static TX_THREAD               thread_123_2;
static TX_THREAD               thread_124_2;
static TX_THREAD               thread_125_2;
static TX_THREAD               thread_126_2;
static TX_THREAD               thread_127_2;
static TX_THREAD               thread_128_2;
static TX_THREAD               thread_129_2;
static TX_THREAD               thread_130_2;
static TX_THREAD               thread_131_2;
static TX_THREAD               thread_132_2;
static TX_THREAD               thread_133_2;
static TX_THREAD               thread_134_2;
static TX_THREAD               thread_135_2;
static TX_THREAD               thread_136_2;
static TX_THREAD               thread_137_2;
static TX_THREAD               thread_138_2;
static TX_THREAD               thread_139_2;
static TX_THREAD               thread_140_2;
static TX_THREAD               thread_141_2;
static TX_THREAD               thread_142_2;
static TX_THREAD               thread_143_2;
static TX_THREAD               thread_144_2;
static TX_THREAD               thread_145_2;
static TX_THREAD               thread_146_2;
static TX_THREAD               thread_147_2;
static TX_THREAD               thread_148_2;
static TX_THREAD               thread_149_2;
static TX_THREAD               thread_150_2;
static TX_THREAD               thread_151_2;
static TX_THREAD               thread_152_2;
static TX_THREAD               thread_153_2;
static TX_THREAD               thread_154_2;
static TX_THREAD               thread_155_2;
static TX_THREAD               thread_156_2;
static TX_THREAD               thread_157_2;
static TX_THREAD               thread_158_2;
static TX_THREAD               thread_159_2;
static TX_THREAD               thread_160_2;
static TX_THREAD               thread_161_2;
static TX_THREAD               thread_162_2;
static TX_THREAD               thread_163_2;
static TX_THREAD               thread_164_2;
static TX_THREAD               thread_165_2;
static TX_THREAD               thread_166_2;
static TX_THREAD               thread_167_2;
static TX_THREAD               thread_168_2;
static TX_THREAD               thread_169_2;
static TX_THREAD               thread_170_2;
static TX_THREAD               thread_171_2;
static TX_THREAD               thread_172_2;
static TX_THREAD               thread_173_2;
static TX_THREAD               thread_174_2;
static TX_THREAD               thread_175_2;
static TX_THREAD               thread_176_2;
static TX_THREAD               thread_177_2;
static TX_THREAD               thread_178_2;
static TX_THREAD               thread_179_2;
static TX_THREAD               thread_180_2;
static TX_THREAD               thread_181_2;
static TX_THREAD               thread_182_2;
static TX_THREAD               thread_183_2;
static TX_THREAD               thread_184_2;
static TX_THREAD               thread_185_2;
static TX_THREAD               thread_186_2;
static TX_THREAD               thread_187_2;
static TX_THREAD               thread_188_2;
static TX_THREAD               thread_189_2;
static TX_THREAD               thread_190_2;
static TX_THREAD               thread_191_2;
static TX_THREAD               thread_192_2;
static TX_THREAD               thread_193_2;
static TX_THREAD               thread_194_2;
static TX_THREAD               thread_195_2;
static TX_THREAD               thread_196_2;
static TX_THREAD               thread_197_2;
static TX_THREAD               thread_198_2;
static TX_THREAD               thread_199_2;
static TX_THREAD               thread_200_2;
static TX_THREAD               thread_201_2;
static TX_THREAD               thread_202_2;
static TX_THREAD               thread_203_2;
static TX_THREAD               thread_204_2;
static TX_THREAD               thread_205_2;
static TX_THREAD               thread_206_2;
static TX_THREAD               thread_207_2;
static TX_THREAD               thread_208_2;
static TX_THREAD               thread_209_2;
static TX_THREAD               thread_210_2;
static TX_THREAD               thread_211_2;
static TX_THREAD               thread_212_2;
static TX_THREAD               thread_213_2;
static TX_THREAD               thread_214_2;
static TX_THREAD               thread_215_2;
static TX_THREAD               thread_216_2;
static TX_THREAD               thread_217_2;
static TX_THREAD               thread_218_2;
static TX_THREAD               thread_219_2;
static TX_THREAD               thread_220_2;
static TX_THREAD               thread_221_2;
static TX_THREAD               thread_222_2;
static TX_THREAD               thread_223_2;
static TX_THREAD               thread_224_2;
static TX_THREAD               thread_225_2;
static TX_THREAD               thread_226_2;
static TX_THREAD               thread_227_2;
static TX_THREAD               thread_228_2;
static TX_THREAD               thread_229_2;
static TX_THREAD               thread_230_2;
static TX_THREAD               thread_231_2;
static TX_THREAD               thread_232_2;
static TX_THREAD               thread_233_2;
static TX_THREAD               thread_234_2;
static TX_THREAD               thread_235_2;
static TX_THREAD               thread_236_2;
static TX_THREAD               thread_237_2;
static TX_THREAD               thread_238_2;
static TX_THREAD               thread_239_2;
static TX_THREAD               thread_240_2;
static TX_THREAD               thread_241_2;
static TX_THREAD               thread_242_2;
static TX_THREAD               thread_243_2;
static TX_THREAD               thread_244_2;
static TX_THREAD               thread_245_2;
static TX_THREAD               thread_246_2;
static TX_THREAD               thread_247_2;
static TX_THREAD               thread_248_2;
static TX_THREAD               thread_249_2;
static TX_THREAD               thread_250_2;
static TX_THREAD               thread_251_2;
static TX_THREAD               thread_252_2;
static TX_THREAD               thread_253_2;
static TX_THREAD               thread_254_2;
static TX_THREAD               thread_255_2;

static TX_THREAD               thread_0_3;
static TX_THREAD               thread_1_3;
static TX_THREAD               thread_2_3;
static TX_THREAD               thread_3_3;
static TX_THREAD               thread_4_3;
static TX_THREAD               thread_5_3;
static TX_THREAD               thread_6_3;
static TX_THREAD               thread_7_3;
static TX_THREAD               thread_8_3;
static TX_THREAD               thread_9_3;
static TX_THREAD               thread_10_3;
static TX_THREAD               thread_11_3;
static TX_THREAD               thread_12_3;
static TX_THREAD               thread_13_3;
static TX_THREAD               thread_14_3;
static TX_THREAD               thread_15_3;
static TX_THREAD               thread_16_3;
static TX_THREAD               thread_17_3;
static TX_THREAD               thread_18_3;
static TX_THREAD               thread_19_3;
static TX_THREAD               thread_20_3;
static TX_THREAD               thread_21_3;
static TX_THREAD               thread_22_3;
static TX_THREAD               thread_23_3;
static TX_THREAD               thread_24_3;
static TX_THREAD               thread_25_3;
static TX_THREAD               thread_26_3;
static TX_THREAD               thread_27_3;
static TX_THREAD               thread_28_3;
static TX_THREAD               thread_29_3;
static TX_THREAD               thread_30_3;
static TX_THREAD               thread_31_3;
static TX_THREAD               thread_32_3;
static TX_THREAD               thread_33_3;
static TX_THREAD               thread_34_3;
static TX_THREAD               thread_35_3;
static TX_THREAD               thread_36_3;
static TX_THREAD               thread_37_3;
static TX_THREAD               thread_38_3;
static TX_THREAD               thread_39_3;
static TX_THREAD               thread_40_3;
static TX_THREAD               thread_41_3;
static TX_THREAD               thread_42_3;
static TX_THREAD               thread_43_3;
static TX_THREAD               thread_44_3;
static TX_THREAD               thread_45_3;
static TX_THREAD               thread_46_3;
static TX_THREAD               thread_47_3;
static TX_THREAD               thread_48_3;
static TX_THREAD               thread_49_3;
static TX_THREAD               thread_50_3;
static TX_THREAD               thread_51_3;
static TX_THREAD               thread_52_3;
static TX_THREAD               thread_53_3;
static TX_THREAD               thread_54_3;
static TX_THREAD               thread_55_3;
static TX_THREAD               thread_56_3;
static TX_THREAD               thread_57_3;
static TX_THREAD               thread_58_3;
static TX_THREAD               thread_59_3;
static TX_THREAD               thread_60_3;
static TX_THREAD               thread_61_3;
static TX_THREAD               thread_62_3;
static TX_THREAD               thread_63_3;
static TX_THREAD               thread_64_3;
static TX_THREAD               thread_65_3;
static TX_THREAD               thread_66_3;
static TX_THREAD               thread_67_3;
static TX_THREAD               thread_68_3;
static TX_THREAD               thread_69_3;
static TX_THREAD               thread_70_3;
static TX_THREAD               thread_71_3;
static TX_THREAD               thread_72_3;
static TX_THREAD               thread_73_3;
static TX_THREAD               thread_74_3;
static TX_THREAD               thread_75_3;
static TX_THREAD               thread_76_3;
static TX_THREAD               thread_77_3;
static TX_THREAD               thread_78_3;
static TX_THREAD               thread_79_3;
static TX_THREAD               thread_80_3;
static TX_THREAD               thread_81_3;
static TX_THREAD               thread_82_3;
static TX_THREAD               thread_83_3;
static TX_THREAD               thread_84_3;
static TX_THREAD               thread_85_3;
static TX_THREAD               thread_86_3;
static TX_THREAD               thread_87_3;
static TX_THREAD               thread_88_3;
static TX_THREAD               thread_89_3;
static TX_THREAD               thread_90_3;
static TX_THREAD               thread_91_3;
static TX_THREAD               thread_92_3;
static TX_THREAD               thread_93_3;
static TX_THREAD               thread_94_3;
static TX_THREAD               thread_95_3;
static TX_THREAD               thread_96_3;
static TX_THREAD               thread_97_3;
static TX_THREAD               thread_98_3;
static TX_THREAD               thread_99_3;
static TX_THREAD               thread_100_3;
static TX_THREAD               thread_101_3;
static TX_THREAD               thread_102_3;
static TX_THREAD               thread_103_3;
static TX_THREAD               thread_104_3;
static TX_THREAD               thread_105_3;
static TX_THREAD               thread_106_3;
static TX_THREAD               thread_107_3;
static TX_THREAD               thread_108_3;
static TX_THREAD               thread_109_3;
static TX_THREAD               thread_110_3;
static TX_THREAD               thread_111_3;
static TX_THREAD               thread_112_3;
static TX_THREAD               thread_113_3;
static TX_THREAD               thread_114_3;
static TX_THREAD               thread_115_3;
static TX_THREAD               thread_116_3;
static TX_THREAD               thread_117_3;
static TX_THREAD               thread_118_3;
static TX_THREAD               thread_119_3;
static TX_THREAD               thread_120_3;
static TX_THREAD               thread_121_3;
static TX_THREAD               thread_122_3;
static TX_THREAD               thread_123_3;
static TX_THREAD               thread_124_3;
static TX_THREAD               thread_125_3;
static TX_THREAD               thread_126_3;
static TX_THREAD               thread_127_3;
static TX_THREAD               thread_128_3;
static TX_THREAD               thread_129_3;
static TX_THREAD               thread_130_3;
static TX_THREAD               thread_131_3;
static TX_THREAD               thread_132_3;
static TX_THREAD               thread_133_3;
static TX_THREAD               thread_134_3;
static TX_THREAD               thread_135_3;
static TX_THREAD               thread_136_3;
static TX_THREAD               thread_137_3;
static TX_THREAD               thread_138_3;
static TX_THREAD               thread_139_3;
static TX_THREAD               thread_140_3;
static TX_THREAD               thread_141_3;
static TX_THREAD               thread_142_3;
static TX_THREAD               thread_143_3;
static TX_THREAD               thread_144_3;
static TX_THREAD               thread_145_3;
static TX_THREAD               thread_146_3;
static TX_THREAD               thread_147_3;
static TX_THREAD               thread_148_3;
static TX_THREAD               thread_149_3;
static TX_THREAD               thread_150_3;
static TX_THREAD               thread_151_3;
static TX_THREAD               thread_152_3;
static TX_THREAD               thread_153_3;
static TX_THREAD               thread_154_3;
static TX_THREAD               thread_155_3;
static TX_THREAD               thread_156_3;
static TX_THREAD               thread_157_3;
static TX_THREAD               thread_158_3;
static TX_THREAD               thread_159_3;
static TX_THREAD               thread_160_3;
static TX_THREAD               thread_161_3;
static TX_THREAD               thread_162_3;
static TX_THREAD               thread_163_3;
static TX_THREAD               thread_164_3;
static TX_THREAD               thread_165_3;
static TX_THREAD               thread_166_3;
static TX_THREAD               thread_167_3;
static TX_THREAD               thread_168_3;
static TX_THREAD               thread_169_3;
static TX_THREAD               thread_170_3;
static TX_THREAD               thread_171_3;
static TX_THREAD               thread_172_3;
static TX_THREAD               thread_173_3;
static TX_THREAD               thread_174_3;
static TX_THREAD               thread_175_3;
static TX_THREAD               thread_176_3;
static TX_THREAD               thread_177_3;
static TX_THREAD               thread_178_3;
static TX_THREAD               thread_179_3;
static TX_THREAD               thread_180_3;
static TX_THREAD               thread_181_3;
static TX_THREAD               thread_182_3;
static TX_THREAD               thread_183_3;
static TX_THREAD               thread_184_3;
static TX_THREAD               thread_185_3;
static TX_THREAD               thread_186_3;
static TX_THREAD               thread_187_3;
static TX_THREAD               thread_188_3;
static TX_THREAD               thread_189_3;
static TX_THREAD               thread_190_3;
static TX_THREAD               thread_191_3;
static TX_THREAD               thread_192_3;
static TX_THREAD               thread_193_3;
static TX_THREAD               thread_194_3;
static TX_THREAD               thread_195_3;
static TX_THREAD               thread_196_3;
static TX_THREAD               thread_197_3;
static TX_THREAD               thread_198_3;
static TX_THREAD               thread_199_3;
static TX_THREAD               thread_200_3;
static TX_THREAD               thread_201_3;
static TX_THREAD               thread_202_3;
static TX_THREAD               thread_203_3;
static TX_THREAD               thread_204_3;
static TX_THREAD               thread_205_3;
static TX_THREAD               thread_206_3;
static TX_THREAD               thread_207_3;
static TX_THREAD               thread_208_3;
static TX_THREAD               thread_209_3;
static TX_THREAD               thread_210_3;
static TX_THREAD               thread_211_3;
static TX_THREAD               thread_212_3;
static TX_THREAD               thread_213_3;
static TX_THREAD               thread_214_3;
static TX_THREAD               thread_215_3;
static TX_THREAD               thread_216_3;
static TX_THREAD               thread_217_3;
static TX_THREAD               thread_218_3;
static TX_THREAD               thread_219_3;
static TX_THREAD               thread_220_3;
static TX_THREAD               thread_221_3;
static TX_THREAD               thread_222_3;
static TX_THREAD               thread_223_3;
static TX_THREAD               thread_224_3;
static TX_THREAD               thread_225_3;
static TX_THREAD               thread_226_3;
static TX_THREAD               thread_227_3;
static TX_THREAD               thread_228_3;
static TX_THREAD               thread_229_3;
static TX_THREAD               thread_230_3;
static TX_THREAD               thread_231_3;
static TX_THREAD               thread_232_3;
static TX_THREAD               thread_233_3;
static TX_THREAD               thread_234_3;
static TX_THREAD               thread_235_3;
static TX_THREAD               thread_236_3;
static TX_THREAD               thread_237_3;
static TX_THREAD               thread_238_3;
static TX_THREAD               thread_239_3;
static TX_THREAD               thread_240_3;
static TX_THREAD               thread_241_3;
static TX_THREAD               thread_242_3;
static TX_THREAD               thread_243_3;
static TX_THREAD               thread_244_3;
static TX_THREAD               thread_245_3;
static TX_THREAD               thread_246_3;
static TX_THREAD               thread_247_3;
static TX_THREAD               thread_248_3;
static TX_THREAD               thread_249_3;
static TX_THREAD               thread_250_3;
static TX_THREAD               thread_251_3;
static TX_THREAD               thread_252_3;
static TX_THREAD               thread_253_3;
static TX_THREAD               thread_254_3;
static TX_THREAD               thread_255_3;

/* Define test array.  */

static TX_THREAD   *_smp_randomized_source_array[] = {
{&thread_0},
{&thread_1},
{&thread_2},
{&thread_3},
{&thread_4},
{&thread_5},
{&thread_6},
{&thread_7},
{&thread_8},
{&thread_9},
{&thread_10},
{&thread_11},
{&thread_12},
{&thread_13},
{&thread_14},
{&thread_15},
{&thread_16},
{&thread_17},
{&thread_18},
{&thread_19},
{&thread_20},
{&thread_21},
{&thread_22},
{&thread_23},
{&thread_24},
{&thread_25},
{&thread_26},
{&thread_27},
{&thread_28},
{&thread_29},
{&thread_30},
{&thread_31},
{&thread_32},
{&thread_33},
{&thread_34},
{&thread_35},
{&thread_36},
{&thread_37},
{&thread_38},
{&thread_39},
{&thread_40},
{&thread_41},
{&thread_42},
{&thread_43},
{&thread_44},
{&thread_45},
{&thread_46},
{&thread_47},
{&thread_48},
{&thread_49},
{&thread_50},
{&thread_51},
{&thread_52},
{&thread_53},
{&thread_54},
{&thread_55},
{&thread_56},
{&thread_57},
{&thread_58},
{&thread_59},
{&thread_60},
{&thread_61},
{&thread_62},
{&thread_63},
{&thread_64},
{&thread_65},
{&thread_66},
{&thread_67},
{&thread_68},
{&thread_69},
{&thread_70},
{&thread_71},
{&thread_72},
{&thread_73},
{&thread_74},
{&thread_75},
{&thread_76},
{&thread_77},
{&thread_78},
{&thread_79},
{&thread_80},
{&thread_81},
{&thread_82},
{&thread_83},
{&thread_84},
{&thread_85},
{&thread_86},
{&thread_87},
{&thread_88},
{&thread_89},
{&thread_90},
{&thread_91},
{&thread_92},
{&thread_93},
{&thread_94},
{&thread_95},
{&thread_96},
{&thread_97},
{&thread_98},
{&thread_99},
{&thread_100},
{&thread_101},
{&thread_102},
{&thread_103},
{&thread_104},
{&thread_105},
{&thread_106},
{&thread_107},
{&thread_108},
{&thread_109},
{&thread_110},
{&thread_111},
{&thread_112},
{&thread_113},
{&thread_114},
{&thread_115},
{&thread_116},
{&thread_117},
{&thread_118},
{&thread_119},
{&thread_120},
{&thread_121},
{&thread_122},
{&thread_123},
{&thread_124},
{&thread_125},
{&thread_126},
{&thread_127},
{&thread_128},
{&thread_129},
{&thread_130},
{&thread_131},
{&thread_132},
{&thread_133},
{&thread_134},
{&thread_135},
{&thread_136},
{&thread_137},
{&thread_138},
{&thread_139},
{&thread_140},
{&thread_141},
{&thread_142},
{&thread_143},
{&thread_144},
{&thread_145},
{&thread_146},
{&thread_147},
{&thread_148},
{&thread_149},
{&thread_150},
{&thread_151},
{&thread_152},
{&thread_153},
{&thread_154},
{&thread_155},
{&thread_156},
{&thread_157},
{&thread_158},
{&thread_159},
{&thread_160},
{&thread_161},
{&thread_162},
{&thread_163},
{&thread_164},
{&thread_165},
{&thread_166},
{&thread_167},
{&thread_168},
{&thread_169},
{&thread_170},
{&thread_171},
{&thread_172},
{&thread_173},
{&thread_174},
{&thread_175},
{&thread_176},
{&thread_177},
{&thread_178},
{&thread_179},
{&thread_180},
{&thread_181},
{&thread_182},
{&thread_183},
{&thread_184},
{&thread_185},
{&thread_186},
{&thread_187},
{&thread_188},
{&thread_189},
{&thread_190},
{&thread_191},
{&thread_192},
{&thread_193},
{&thread_194},
{&thread_195},
{&thread_196},
{&thread_197},
{&thread_198},
{&thread_199},
{&thread_200},
{&thread_201},
{&thread_202},
{&thread_203},
{&thread_204},
{&thread_205},
{&thread_206},
{&thread_207},
{&thread_208},
{&thread_209},
{&thread_210},
{&thread_211},
{&thread_212},
{&thread_213},
{&thread_214},
{&thread_215},
{&thread_216},
{&thread_217},
{&thread_218},
{&thread_219},
{&thread_220},
{&thread_221},
{&thread_222},
{&thread_223},
{&thread_224},
{&thread_225},
{&thread_226},
{&thread_227},
{&thread_228},
{&thread_229},
{&thread_230},
{&thread_231},
{&thread_232},
{&thread_233},
{&thread_234},
{&thread_235},
{&thread_236},
{&thread_237},
{&thread_238},
{&thread_239},
{&thread_240},
{&thread_241},
{&thread_242},
{&thread_243},
{&thread_244},
{&thread_245},
{&thread_246},
{&thread_247},
{&thread_248},
{&thread_249},
{&thread_250},
{&thread_251},
{&thread_252},
{&thread_253},
{&thread_254},
{&thread_255},

{&thread_0_1},
{&thread_1_1},
{&thread_2_1},
{&thread_3_1},
{&thread_4_1},
{&thread_5_1},
{&thread_6_1},
{&thread_7_1},
{&thread_8_1},
{&thread_9_1},
{&thread_10_1},
{&thread_11_1},
{&thread_12_1},
{&thread_13_1},
{&thread_14_1},
{&thread_15_1},
{&thread_16_1},
{&thread_17_1},
{&thread_18_1},
{&thread_19_1},
{&thread_20_1},
{&thread_21_1},
{&thread_22_1},
{&thread_23_1},
{&thread_24_1},
{&thread_25_1},
{&thread_26_1},
{&thread_27_1},
{&thread_28_1},
{&thread_29_1},
{&thread_30_1},
{&thread_31_1},
{&thread_32_1},
{&thread_33_1},
{&thread_34_1},
{&thread_35_1},
{&thread_36_1},
{&thread_37_1},
{&thread_38_1},
{&thread_39_1},
{&thread_40_1},
{&thread_41_1},
{&thread_42_1},
{&thread_43_1},
{&thread_44_1},
{&thread_45_1},
{&thread_46_1},
{&thread_47_1},
{&thread_48_1},
{&thread_49_1},
{&thread_50_1},
{&thread_51_1},
{&thread_52_1},
{&thread_53_1},
{&thread_54_1},
{&thread_55_1},
{&thread_56_1},
{&thread_57_1},
{&thread_58_1},
{&thread_59_1},
{&thread_60_1},
{&thread_61_1},
{&thread_62_1},
{&thread_63_1},
{&thread_64_1},
{&thread_65_1},
{&thread_66_1},
{&thread_67_1},
{&thread_68_1},
{&thread_69_1},
{&thread_70_1},
{&thread_71_1},
{&thread_72_1},
{&thread_73_1},
{&thread_74_1},
{&thread_75_1},
{&thread_76_1},
{&thread_77_1},
{&thread_78_1},
{&thread_79_1},
{&thread_80_1},
{&thread_81_1},
{&thread_82_1},
{&thread_83_1},
{&thread_84_1},
{&thread_85_1},
{&thread_86_1},
{&thread_87_1},
{&thread_88_1},
{&thread_89_1},
{&thread_90_1},
{&thread_91_1},
{&thread_92_1},
{&thread_93_1},
{&thread_94_1},
{&thread_95_1},
{&thread_96_1},
{&thread_97_1},
{&thread_98_1},
{&thread_99_1},
{&thread_100_1},
{&thread_101_1},
{&thread_102_1},
{&thread_103_1},
{&thread_104_1},
{&thread_105_1},
{&thread_106_1},
{&thread_107_1},
{&thread_108_1},
{&thread_109_1},
{&thread_110_1},
{&thread_111_1},
{&thread_112_1},
{&thread_113_1},
{&thread_114_1},
{&thread_115_1},
{&thread_116_1},
{&thread_117_1},
{&thread_118_1},
{&thread_119_1},
{&thread_120_1},
{&thread_121_1},
{&thread_122_1},
{&thread_123_1},
{&thread_124_1},
{&thread_125_1},
{&thread_126_1},
{&thread_127_1},
{&thread_128_1},
{&thread_129_1},
{&thread_130_1},
{&thread_131_1},
{&thread_132_1},
{&thread_133_1},
{&thread_134_1},
{&thread_135_1},
{&thread_136_1},
{&thread_137_1},
{&thread_138_1},
{&thread_139_1},
{&thread_140_1},
{&thread_141_1},
{&thread_142_1},
{&thread_143_1},
{&thread_144_1},
{&thread_145_1},
{&thread_146_1},
{&thread_147_1},
{&thread_148_1},
{&thread_149_1},
{&thread_150_1},
{&thread_151_1},
{&thread_152_1},
{&thread_153_1},
{&thread_154_1},
{&thread_155_1},
{&thread_156_1},
{&thread_157_1},
{&thread_158_1},
{&thread_159_1},
{&thread_160_1},
{&thread_161_1},
{&thread_162_1},
{&thread_163_1},
{&thread_164_1},
{&thread_165_1},
{&thread_166_1},
{&thread_167_1},
{&thread_168_1},
{&thread_169_1},
{&thread_170_1},
{&thread_171_1},
{&thread_172_1},
{&thread_173_1},
{&thread_174_1},
{&thread_175_1},
{&thread_176_1},
{&thread_177_1},
{&thread_178_1},
{&thread_179_1},
{&thread_180_1},
{&thread_181_1},
{&thread_182_1},
{&thread_183_1},
{&thread_184_1},
{&thread_185_1},
{&thread_186_1},
{&thread_187_1},
{&thread_188_1},
{&thread_189_1},
{&thread_190_1},
{&thread_191_1},
{&thread_192_1},
{&thread_193_1},
{&thread_194_1},
{&thread_195_1},
{&thread_196_1},
{&thread_197_1},
{&thread_198_1},
{&thread_199_1},
{&thread_200_1},
{&thread_201_1},
{&thread_202_1},
{&thread_203_1},
{&thread_204_1},
{&thread_205_1},
{&thread_206_1},
{&thread_207_1},
{&thread_208_1},
{&thread_209_1},
{&thread_210_1},
{&thread_211_1},
{&thread_212_1},
{&thread_213_1},
{&thread_214_1},
{&thread_215_1},
{&thread_216_1},
{&thread_217_1},
{&thread_218_1},
{&thread_219_1},
{&thread_220_1},
{&thread_221_1},
{&thread_222_1},
{&thread_223_1},
{&thread_224_1},
{&thread_225_1},
{&thread_226_1},
{&thread_227_1},
{&thread_228_1},
{&thread_229_1},
{&thread_230_1},
{&thread_231_1},
{&thread_232_1},
{&thread_233_1},
{&thread_234_1},
{&thread_235_1},
{&thread_236_1},
{&thread_237_1},
{&thread_238_1},
{&thread_239_1},
{&thread_240_1},
{&thread_241_1},
{&thread_242_1},
{&thread_243_1},
{&thread_244_1},
{&thread_245_1},
{&thread_246_1},
{&thread_247_1},
{&thread_248_1},
{&thread_249_1},
{&thread_250_1},
{&thread_251_1},
{&thread_252_1},
{&thread_253_1},
{&thread_254_1},
{&thread_255_1},

{&thread_0_2},
{&thread_1_2},
{&thread_2_2},
{&thread_3_2},
{&thread_4_2},
{&thread_5_2},
{&thread_6_2},
{&thread_7_2},
{&thread_8_2},
{&thread_9_2},
{&thread_10_2},
{&thread_11_2},
{&thread_12_2},
{&thread_13_2},
{&thread_14_2},
{&thread_15_2},
{&thread_16_2},
{&thread_17_2},
{&thread_18_2},
{&thread_19_2},
{&thread_20_2},
{&thread_21_2},
{&thread_22_2},
{&thread_23_2},
{&thread_24_2},
{&thread_25_2},
{&thread_26_2},
{&thread_27_2},
{&thread_28_2},
{&thread_29_2},
{&thread_30_2},
{&thread_31_2},
{&thread_32_2},
{&thread_33_2},
{&thread_34_2},
{&thread_35_2},
{&thread_36_2},
{&thread_37_2},
{&thread_38_2},
{&thread_39_2},
{&thread_40_2},
{&thread_41_2},
{&thread_42_2},
{&thread_43_2},
{&thread_44_2},
{&thread_45_2},
{&thread_46_2},
{&thread_47_2},
{&thread_48_2},
{&thread_49_2},
{&thread_50_2},
{&thread_51_2},
{&thread_52_2},
{&thread_53_2},
{&thread_54_2},
{&thread_55_2},
{&thread_56_2},
{&thread_57_2},
{&thread_58_2},
{&thread_59_2},
{&thread_60_2},
{&thread_61_2},
{&thread_62_2},
{&thread_63_2},
{&thread_64_2},
{&thread_65_2},
{&thread_66_2},
{&thread_67_2},
{&thread_68_2},
{&thread_69_2},
{&thread_70_2},
{&thread_71_2},
{&thread_72_2},
{&thread_73_2},
{&thread_74_2},
{&thread_75_2},
{&thread_76_2},
{&thread_77_2},
{&thread_78_2},
{&thread_79_2},
{&thread_80_2},
{&thread_81_2},
{&thread_82_2},
{&thread_83_2},
{&thread_84_2},
{&thread_85_2},
{&thread_86_2},
{&thread_87_2},
{&thread_88_2},
{&thread_89_2},
{&thread_90_2},
{&thread_91_2},
{&thread_92_2},
{&thread_93_2},
{&thread_94_2},
{&thread_95_2},
{&thread_96_2},
{&thread_97_2},
{&thread_98_2},
{&thread_99_2},
{&thread_100_2},
{&thread_101_2},
{&thread_102_2},
{&thread_103_2},
{&thread_104_2},
{&thread_105_2},
{&thread_106_2},
{&thread_107_2},
{&thread_108_2},
{&thread_109_2},
{&thread_110_2},
{&thread_111_2},
{&thread_112_2},
{&thread_113_2},
{&thread_114_2},
{&thread_115_2},
{&thread_116_2},
{&thread_117_2},
{&thread_118_2},
{&thread_119_2},
{&thread_120_2},
{&thread_121_2},
{&thread_122_2},
{&thread_123_2},
{&thread_124_2},
{&thread_125_2},
{&thread_126_2},
{&thread_127_2},
{&thread_128_2},
{&thread_129_2},
{&thread_130_2},
{&thread_131_2},
{&thread_132_2},
{&thread_133_2},
{&thread_134_2},
{&thread_135_2},
{&thread_136_2},
{&thread_137_2},
{&thread_138_2},
{&thread_139_2},
{&thread_140_2},
{&thread_141_2},
{&thread_142_2},
{&thread_143_2},
{&thread_144_2},
{&thread_145_2},
{&thread_146_2},
{&thread_147_2},
{&thread_148_2},
{&thread_149_2},
{&thread_150_2},
{&thread_151_2},
{&thread_152_2},
{&thread_153_2},
{&thread_154_2},
{&thread_155_2},
{&thread_156_2},
{&thread_157_2},
{&thread_158_2},
{&thread_159_2},
{&thread_160_2},
{&thread_161_2},
{&thread_162_2},
{&thread_163_2},
{&thread_164_2},
{&thread_165_2},
{&thread_166_2},
{&thread_167_2},
{&thread_168_2},
{&thread_169_2},
{&thread_170_2},
{&thread_171_2},
{&thread_172_2},
{&thread_173_2},
{&thread_174_2},
{&thread_175_2},
{&thread_176_2},
{&thread_177_2},
{&thread_178_2},
{&thread_179_2},
{&thread_180_2},
{&thread_181_2},
{&thread_182_2},
{&thread_183_2},
{&thread_184_2},
{&thread_185_2},
{&thread_186_2},
{&thread_187_2},
{&thread_188_2},
{&thread_189_2},
{&thread_190_2},
{&thread_191_2},
{&thread_192_2},
{&thread_193_2},
{&thread_194_2},
{&thread_195_2},
{&thread_196_2},
{&thread_197_2},
{&thread_198_2},
{&thread_199_2},
{&thread_200_2},
{&thread_201_2},
{&thread_202_2},
{&thread_203_2},
{&thread_204_2},
{&thread_205_2},
{&thread_206_2},
{&thread_207_2},
{&thread_208_2},
{&thread_209_2},
{&thread_210_2},
{&thread_211_2},
{&thread_212_2},
{&thread_213_2},
{&thread_214_2},
{&thread_215_2},
{&thread_216_2},
{&thread_217_2},
{&thread_218_2},
{&thread_219_2},
{&thread_220_2},
{&thread_221_2},
{&thread_222_2},
{&thread_223_2},
{&thread_224_2},
{&thread_225_2},
{&thread_226_2},
{&thread_227_2},
{&thread_228_2},
{&thread_229_2},
{&thread_230_2},
{&thread_231_2},
{&thread_232_2},
{&thread_233_2},
{&thread_234_2},
{&thread_235_2},
{&thread_236_2},
{&thread_237_2},
{&thread_238_2},
{&thread_239_2},
{&thread_240_2},
{&thread_241_2},
{&thread_242_2},
{&thread_243_2},
{&thread_244_2},
{&thread_245_2},
{&thread_246_2},
{&thread_247_2},
{&thread_248_2},
{&thread_249_2},
{&thread_250_2},
{&thread_251_2},
{&thread_252_2},
{&thread_253_2},
{&thread_254_2},
{&thread_255_2},

{&thread_0_3},
{&thread_1_3},
{&thread_2_3},
{&thread_3_3},
{&thread_4_3},
{&thread_5_3},
{&thread_6_3},
{&thread_7_3},
{&thread_8_3},
{&thread_9_3},
{&thread_10_3},
{&thread_11_3},
{&thread_12_3},
{&thread_13_3},
{&thread_14_3},
{&thread_15_3},
{&thread_16_3},
{&thread_17_3},
{&thread_18_3},
{&thread_19_3},
{&thread_20_3},
{&thread_21_3},
{&thread_22_3},
{&thread_23_3},
{&thread_24_3},
{&thread_25_3},
{&thread_26_3},
{&thread_27_3},
{&thread_28_3},
{&thread_29_3},
{&thread_30_3},
{&thread_31_3},
{&thread_32_3},
{&thread_33_3},
{&thread_34_3},
{&thread_35_3},
{&thread_36_3},
{&thread_37_3},
{&thread_38_3},
{&thread_39_3},
{&thread_40_3},
{&thread_41_3},
{&thread_42_3},
{&thread_43_3},
{&thread_44_3},
{&thread_45_3},
{&thread_46_3},
{&thread_47_3},
{&thread_48_3},
{&thread_49_3},
{&thread_50_3},
{&thread_51_3},
{&thread_52_3},
{&thread_53_3},
{&thread_54_3},
{&thread_55_3},
{&thread_56_3},
{&thread_57_3},
{&thread_58_3},
{&thread_59_3},
{&thread_60_3},
{&thread_61_3},
{&thread_62_3},
{&thread_63_3},
{&thread_64_3},
{&thread_65_3},
{&thread_66_3},
{&thread_67_3},
{&thread_68_3},
{&thread_69_3},
{&thread_70_3},
{&thread_71_3},
{&thread_72_3},
{&thread_73_3},
{&thread_74_3},
{&thread_75_3},
{&thread_76_3},
{&thread_77_3},
{&thread_78_3},
{&thread_79_3},
{&thread_80_3},
{&thread_81_3},
{&thread_82_3},
{&thread_83_3},
{&thread_84_3},
{&thread_85_3},
{&thread_86_3},
{&thread_87_3},
{&thread_88_3},
{&thread_89_3},
{&thread_90_3},
{&thread_91_3},
{&thread_92_3},
{&thread_93_3},
{&thread_94_3},
{&thread_95_3},
{&thread_96_3},
{&thread_97_3},
{&thread_98_3},
{&thread_99_3},
{&thread_100_3},
{&thread_101_3},
{&thread_102_3},
{&thread_103_3},
{&thread_104_3},
{&thread_105_3},
{&thread_106_3},
{&thread_107_3},
{&thread_108_3},
{&thread_109_3},
{&thread_110_3},
{&thread_111_3},
{&thread_112_3},
{&thread_113_3},
{&thread_114_3},
{&thread_115_3},
{&thread_116_3},
{&thread_117_3},
{&thread_118_3},
{&thread_119_3},
{&thread_120_3},
{&thread_121_3},
{&thread_122_3},
{&thread_123_3},
{&thread_124_3},
{&thread_125_3},
{&thread_126_3},
{&thread_127_3},
{&thread_128_3},
{&thread_129_3},
{&thread_130_3},
{&thread_131_3},
{&thread_132_3},
{&thread_133_3},
{&thread_134_3},
{&thread_135_3},
{&thread_136_3},
{&thread_137_3},
{&thread_138_3},
{&thread_139_3},
{&thread_140_3},
{&thread_141_3},
{&thread_142_3},
{&thread_143_3},
{&thread_144_3},
{&thread_145_3},
{&thread_146_3},
{&thread_147_3},
{&thread_148_3},
{&thread_149_3},
{&thread_150_3},
{&thread_151_3},
{&thread_152_3},
{&thread_153_3},
{&thread_154_3},
{&thread_155_3},
{&thread_156_3},
{&thread_157_3},
{&thread_158_3},
{&thread_159_3},
{&thread_160_3},
{&thread_161_3},
{&thread_162_3},
{&thread_163_3},
{&thread_164_3},
{&thread_165_3},
{&thread_166_3},
{&thread_167_3},
{&thread_168_3},
{&thread_169_3},
{&thread_170_3},
{&thread_171_3},
{&thread_172_3},
{&thread_173_3},
{&thread_174_3},
{&thread_175_3},
{&thread_176_3},
{&thread_177_3},
{&thread_178_3},
{&thread_179_3},
{&thread_180_3},
{&thread_181_3},
{&thread_182_3},
{&thread_183_3},
{&thread_184_3},
{&thread_185_3},
{&thread_186_3},
{&thread_187_3},
{&thread_188_3},
{&thread_189_3},
{&thread_190_3},
{&thread_191_3},
{&thread_192_3},
{&thread_193_3},
{&thread_194_3},
{&thread_195_3},
{&thread_196_3},
{&thread_197_3},
{&thread_198_3},
{&thread_199_3},
{&thread_200_3},
{&thread_201_3},
{&thread_202_3},
{&thread_203_3},
{&thread_204_3},
{&thread_205_3},
{&thread_206_3},
{&thread_207_3},
{&thread_208_3},
{&thread_209_3},
{&thread_210_3},
{&thread_211_3},
{&thread_212_3},
{&thread_213_3},
{&thread_214_3},
{&thread_215_3},
{&thread_216_3},
{&thread_217_3},
{&thread_218_3},
{&thread_219_3},
{&thread_220_3},
{&thread_221_3},
{&thread_222_3},
{&thread_223_3},
{&thread_224_3},
{&thread_225_3},
{&thread_226_3},
{&thread_227_3},
{&thread_228_3},
{&thread_229_3},
{&thread_230_3},
{&thread_231_3},
{&thread_232_3},
{&thread_233_3},
{&thread_234_3},
{&thread_235_3},
{&thread_236_3},
{&thread_237_3},
{&thread_238_3},
{&thread_239_3},
{&thread_240_3},
{&thread_241_3},
{&thread_242_3},
{&thread_243_3},
{&thread_244_3},
{&thread_245_3},
{&thread_246_3},
{&thread_247_3},
{&thread_248_3},
{&thread_249_3},
{&thread_250_3},
{&thread_251_3},
{&thread_252_3},
{&thread_253_3},
{&thread_254_3},
{&thread_255_3}
};

/* Define the test array.  This used to store the randomized test.  */

static TX_THREAD               *_smp_randomized_test_array[TX_THREAD_SMP_MAX_CORES*2];


/* Define thread entry prototype. Since it won't be used it can be the same.  */

static void    control_thread_entry(ULONG thread_input);
static void    thread_entry(ULONG thread_input);


/* Prototype for test control return.  */

void  test_control_return(UINT status);



static UINT    pass;
static UINT    start_pass;
static UINT    end_pass;


/* Create a test control thread.  */

static TX_THREAD    control_thread;



/* Define what the initial system looks like.  */

#ifdef CTEST
void test_application_define(void *first_unused_memory)
#else
void    threadx_smp_random_resume_suspend_test(void *first_unused_memory)
#endif
{

CHAR        *pointer;
UINT        status;

    /* Put first available memory address into a character pointer.  */
    pointer =  (CHAR *) first_unused_memory;

    /* Create a control thread to run the test.  */
    status =  tx_thread_create(&control_thread, "control thread", control_thread_entry, 0,
            pointer, 1024,
            0, 0, TX_NO_TIME_SLICE, TX_AUTO_START);

    /* Check status.  */
    if (status != TX_SUCCESS)
    {

        printf("Running SMP Random Suspensions/Resumptions Test..................... ERROR #1\n");
        test_control_return(1);
    }
}


static void    control_thread_entry(ULONG thread_input)
{

UINT        i, j;
UINT        priority;
UINT        source_index;
UINT        successful_tests =  0;
UINT        test_errors =  0;
TX_THREAD   *thread_ptr;
TX_THREAD   *current_thread;
UINT        original_priority;
UINT        status;


    /* Pickup the current thread pointer.  */
    current_thread =  tx_thread_identify();

    /* Loop to create all the threads.  */
    i =  0;
    priority =  0;
    status =  TX_SUCCESS;
    while (i < 1024)
    {

        /* Create each thread.  */
        status +=  tx_thread_create(_smp_randomized_source_array[i], "test thread", thread_entry, i,
//            (void *) pointer, 512,
            malloc(1024), 1024,
            priority, priority, TX_NO_TIME_SLICE, TX_DONT_START);
//        pointer =  pointer + 512;

        /* Check status.  */
        if (status != TX_SUCCESS)
        {

            printf("Running SMP Random Suspensions/Resumptions Test..................... ERROR #2\n");
            test_control_return(1);
            break;
        }

        /* Move to next entry/priority.  */
        i++;
        priority++;

        /* Should priority be reset?  */
		if (priority >= TX_MAX_PRIORITIES)
		{

			/* Yes, reset the priority.  */
			priority =  0;
		}
    }

    /* Start random test.  */
    printf("Running SMP Random Suspensions/Resumptions Test..................... ");

    /* Clear system counters.  */
    pass =         0;
    start_pass =   0;
    end_pass =     start_pass + MAX_PASSES;
    do
    {

        /* Clear the randomized test array.  */
        for (i = 0; i < (TX_THREAD_SMP_MAX_CORES*2); i++)
        {
            _smp_randomized_test_array[i] = TX_NULL;
        }

        /* Build the randomized test array.  */
        for (i = 0; i < (TX_THREAD_SMP_MAX_CORES*2); i++)
        {
            do
            {
                source_index =  (rand())%1024;

                /* Determine if this index has repeated.  */
                thread_ptr = _smp_randomized_source_array[source_index];

                /* Is this thread already in the test array?  */
                j =  0;
                while (j < TX_THREAD_SMP_MAX_CORES*2)
                {
                    /* Is the entry NULL?  */
                    if (_smp_randomized_test_array[j] == TX_NULL)
                    {
                        j =  (TX_THREAD_SMP_MAX_CORES*2);
                    }

                    /* Determine if we have a duplicate.  */
                    if (_smp_randomized_test_array[j] == thread_ptr)
						thread_ptr =  TX_NULL;

                    j++;
                }

             } while (thread_ptr == TX_NULL);

            /* Clear run counter.  */
            thread_ptr -> tx_thread_run_count =  0;

            /* Save the thread pointer.  */
            _smp_randomized_test_array[i] =  thread_ptr;
        }

        /* Now make all the random threads ready.  */
        for (i = 0; i < (TX_THREAD_SMP_MAX_CORES*2); i++)
        {
            status =  tx_thread_resume(_smp_randomized_test_array[i]);

            /* Check for an error.  */
            if (status != TX_SUCCESS)
            {

                printf("ERROR #3\n");
                test_control_return(1);
				break;
            }
        }

        /* Check the status.  */
        if (status)
            break;

        /* Move to the lowest priority.  */
        status    +=  tx_thread_priority_change(current_thread, TX_MAX_PRIORITIES-1, &original_priority);
		tx_thread_relinquish();

        /* At this point all the threads have run, or should have.  */

        /* Restore priority.  */
        status   +=  tx_thread_priority_change(current_thread, original_priority, &original_priority);

        /* Was there an error?  */
        if (status != TX_SUCCESS)
        {

             printf("ERROR #4\n");
             test_control_return(1);
             break;
        }

        /* Determine if all the threads in the the random sample ran.  */
        for (i = 0; i < (TX_THREAD_SMP_MAX_CORES*2); i++)
        {

            /* Pickup the thread pointer.  */
			thread_ptr =  _smp_randomized_test_array[i];

            /* Check to see if each thread has run.  */
            if (thread_ptr -> tx_thread_run_count == 0)
            {

                /* First, try to sleep to see if this helps!  */
                tx_thread_sleep(1);
            }

			/* Has the run count incremented?  */
            if (thread_ptr -> tx_thread_run_count == 0)
            {

				 /* No, this thread didn't really run!  */
                 printf("ERROR #5\n");
                 test_control_return(1);
                 break;
            }

			/* Make sure this thread suspended.  */
            while (thread_ptr -> tx_thread_state != TX_SUSPENDED)
            {
				/* Wait for the thread to complete!  */
				tx_thread_relinquish();
			}
        }

        /* Increment the pass counter.  */
        pass++;

    } while (pass < end_pass);

    /* Test is successful!  */
    printf("SUCCESS!\n");
    test_control_return(0);
}


static void thread_entry(ULONG id)
{

    /* While forever loop!  */
    while(1)
    {

        /* Suspend thread!  */
        tx_thread_suspend(_smp_randomized_source_array[id]);
    }
}