FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing/app/src/processing/app/exec/ProcessRegistry.java at master · ishit/processing · GitHub
ishit
processing
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
processing
/
app
/
src
/
processing
/
app
/
exec
/
ProcessRegistry.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (34 loc) · 873 Bytes
Breadcrumbs
processing
/
app
/
src
/
processing
/
app
/
exec
/
ProcessRegistry.java
Copy path
File metadata and controls
40 lines (34 loc) · 873 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package
processing
.
app
.
exec
;
import
java
.
util
.
Collections
;
import
java
.
util
.
HashSet
;
import
java
.
util
.
Set
;
public
class
ProcessRegistry
{
private
static
final
Set
<
Process
>
REGISTRY
=
Collections
.
synchronizedSet
(
new
HashSet
<
Process
>());
static
{
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
() {
@
Override
public
void
run
() {
synchronized
(
REGISTRY
) {
for
(
final
Process
p
:
REGISTRY
) {
try
{
// System.err.println("Cleaning up rogue process " + p);
p
.
destroy
();
}
catch
(
final
Exception
drop
) {
}
}
}
}
});
}
/**
* When starting up a process
* @param p
*/
public
static
void
watch
(
final
Process
p
) {
REGISTRY
.
add
(
p
);
}
public
static
void
unwatch
(
final
Process
p
) {
REGISTRY
.
remove
(
p
);
}
}
Back
|
FazBrowse Home
|
New Git URL