1
00:00:00,800 --> 00:00:01,840
Hello, welcome back.

2
00:00:01,850 --> 00:00:07,490
And this lesson, we're going to see how to suspend a threat, I'm going to make a copy of our last

3
00:00:07,490 --> 00:00:08,660
project over here.

4
00:00:10,000 --> 00:00:17,350
I'll copy this and paste over here, and I'll simply call this thread suspend.

5
00:00:23,680 --> 00:00:24,250
Like this.

6
00:00:27,380 --> 00:00:28,480
Copy over here.

7
00:00:30,620 --> 00:00:39,110
And this is similar to the threat suspend we had used in our native free ARTUS APIs, so I would advise

8
00:00:39,110 --> 00:00:45,320
you post the video and try to implement the same thing using the census artist to APIs.

9
00:00:45,470 --> 00:00:52,490
And you can go to our documentation here to find the appropriate API to use for this.

10
00:00:52,730 --> 00:00:55,370
Of course, you can simply fine over here.

11
00:00:55,370 --> 00:00:59,110
There's always threat to suspend API rights.

12
00:00:59,110 --> 00:01:04,770
So post the video and try to just support our old OS threat to suspend.

13
00:01:05,160 --> 00:01:07,670
Remember, we have one who has threats to spend somewhere.

14
00:01:08,150 --> 00:01:08,780
Where is it?

15
00:01:11,270 --> 00:01:13,010
Number four or something.

16
00:01:15,000 --> 00:01:21,300
Let's see, we suspended the threat, OK, number eight, suspend the threat, we're going to implement

17
00:01:21,300 --> 00:01:23,620
the same thing using Simms's artists.

18
00:01:24,240 --> 00:01:26,700
OK, so I'm sure you've tried on your own.

19
00:01:27,120 --> 00:01:32,490
So the projects we made a copy of changes the change, the priority of one of the threads.

20
00:01:32,760 --> 00:01:35,280
So I'm going to delete that piece of code.

21
00:01:38,300 --> 00:01:41,540
This is where we we let's see, where is it?

22
00:01:44,860 --> 00:01:47,770
Which one is this we are here threaten to suspend.

23
00:01:54,400 --> 00:01:59,740
OK, so I think I ended up making a copy of a threat creates function.

24
00:02:01,780 --> 00:02:10,900
OK, so I'm going to actually quickly make a copy of our threat priority, our threat, threat, priority

25
00:02:10,900 --> 00:02:17,440
quote, The reason why that is, is because we would have to type again and add the threat IDs.

26
00:02:20,270 --> 00:02:26,610
OK, so this is a copy of our always our top priority project.

27
00:02:27,140 --> 00:02:29,060
So in this project, we.

28
00:02:30,780 --> 00:02:37,590
We thought the threat I'd returned from the new threat in their respective variables and over here.

29
00:02:38,990 --> 00:02:44,430
The orange bellied controller threat changed the priority of the green threat.

30
00:02:44,690 --> 00:02:45,410
We don't need that.

31
00:02:45,590 --> 00:02:52,000
So I'm going to delete this, OK, so what I'm going to do is just like we did in our previous project,

32
00:02:52,610 --> 00:02:55,400
I'm going to define a number of global variables.

33
00:02:56,090 --> 00:02:57,380
I'll use a counter.

34
00:02:57,410 --> 00:03:03,410
And when the counter counts to a particular amount, we're going to suspend one of the threats.

35
00:03:03,680 --> 00:03:07,450
So we use the counter code, suspend monitor.

36
00:03:07,460 --> 00:03:09,140
We're going to just use the same thing here.

37
00:03:09,150 --> 00:03:11,750
So I'm going to define, suspend monitor over here.

38
00:03:12,330 --> 00:03:18,130
And what I'm going to say is, OK, suspension, it's a plus plus over here.

39
00:03:19,970 --> 00:03:24,080
So whenever there's an iteration, suspend monitor the screen to.

40
00:03:27,010 --> 00:03:30,520
It's going to increment and we can see if suspend monitor.

41
00:03:32,820 --> 00:03:43,050
Is greater than or equal to forty nine, then we want to suspend blue thread this delay that we use

42
00:03:43,050 --> 00:03:43,240
here.

43
00:03:43,260 --> 00:03:48,060
This from I equals zero I less than seven hundred thousand.

44
00:03:48,090 --> 00:03:53,010
I'm going to simply change this to I less than seven thousand for each thread.

45
00:03:55,580 --> 00:04:00,750
So that we can increment more quickly, so we have seven thousand No.

46
00:04:02,240 --> 00:04:10,820
OK, so we're going to suspend using the EU's threat suspend function, let's wait and see what we've

47
00:04:10,820 --> 00:04:11,070
got.

48
00:04:11,900 --> 00:04:13,070
Click over here to build.

49
00:04:17,490 --> 00:04:21,270
It's built successfully, right click.

50
00:04:22,290 --> 00:04:24,240
I'll see debuggers.

51
00:04:26,320 --> 00:04:27,010
Where are we?

52
00:04:29,780 --> 00:04:30,940
Debuggers, OK?

53
00:04:33,790 --> 00:04:35,380
And then OK, over here.

54
00:04:41,270 --> 00:04:42,230
A click to switch.

55
00:04:48,210 --> 00:04:50,130
And I'm going to click here to run.

56
00:04:52,780 --> 00:04:54,130
Yeah, all incrementing.

57
00:04:55,160 --> 00:04:57,320
And as you can see, they've all stopped.

58
00:04:58,580 --> 00:04:59,900
Let's see what's happening here.

59
00:05:00,340 --> 00:05:03,940
It seems we are running the old cold because we have this green run in here.

60
00:05:04,290 --> 00:05:04,750
OK.

61
00:05:08,000 --> 00:05:13,940
The old court run in Cuba makes likes doing this, you see, we are running the thread priority code,

62
00:05:14,460 --> 00:05:18,140
OK, I'm going to close this and I'm going to do it again.

63
00:05:19,580 --> 00:05:21,860
Where is this we have to suspend?

64
00:05:23,200 --> 00:05:30,790
We're going to close this and then open our Simms's thread to suspend open demand or C followed by here.

65
00:05:32,760 --> 00:05:33,390
And.

66
00:05:35,450 --> 00:05:36,050
Let's see.

67
00:05:36,620 --> 00:05:43,540
OK, so this is our quote that we added, OK, we're going to click here, right click we're going to

68
00:05:43,820 --> 00:05:44,900
be able to project.

69
00:05:49,910 --> 00:05:57,470
It's about we're going to right click, we're going to say debuggers SDM 32, we're going to select

70
00:05:57,470 --> 00:05:59,420
thirty seven, our latest project.

71
00:06:01,210 --> 00:06:02,620
Then we're going to say, OK.

72
00:06:11,160 --> 00:06:12,120
Then switch.

73
00:06:17,880 --> 00:06:18,690
It's Lodin.

74
00:06:20,710 --> 00:06:22,750
It's already so click here to run.

75
00:06:24,220 --> 00:06:30,690
You can see we have them incrementing faster, but bluegill suspended when we hit 50, just like we

76
00:06:30,690 --> 00:06:31,010
said.

77
00:06:31,590 --> 00:06:33,970
So this is very simple, very straightforward.

78
00:06:34,320 --> 00:06:39,270
We've seen this before using the native apes as The Simpsons Arktos to version.

79
00:06:39,720 --> 00:06:43,350
And the next lesson, of course, we'll see how to resume a suspended thread.

80
00:06:43,710 --> 00:06:49,110
But I would I would ask you to try it out on your own before you open the next lesson.

81
00:06:49,560 --> 00:06:51,150
So I'll see you in the next lesson.
