FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
algorithm/BlockingQueue/src/Producer.java at master · wodgithub/algorithm · GitHub
wodgithub
algorithm
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
algorithm
/
BlockingQueue
/
src
/
Producer.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (20 loc) · 590 Bytes
Breadcrumbs
algorithm
/
BlockingQueue
/
src
/
Producer.java
Copy path
File metadata and controls
23 lines (20 loc) · 590 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public
class
Producer
implements
Runnable
{
protected
BlockingQueue
queue
;
public
Producer
(
BlockingQueue
queue
) {
this
.
queue
=
queue
;
}
public
void
run
() {
try
{
queue
.
enqueue
(
"1"
);
System
.
out
.
println
(
"producter 1"
);
Thread
.
sleep
(
1000
);
queue
.
enqueue
(
"2"
);
System
.
out
.
println
(
"producter 2"
);
Thread
.
sleep
(
1000
);
queue
.
enqueue
(
"3"
);
System
.
out
.
println
(
"producter 3"
);
}
catch
(
InterruptedException
e
) {
e
.
printStackTrace
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL