Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
937f8576
Commit
937f8576
authored
Aug 18, 2016
by
hengyunabc
Committed by
Andy Wilkinson
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that LaunchedURLClassLoader works when thread is interrupted
See gh-6683
parent
ffc0dc44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
RandomAccessDataFile.java
...pringframework/boot/loader/data/RandomAccessDataFile.java
+12
-25
No files found.
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java
View file @
937f8576
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -244,17 +244,10 @@ public class RandomAccessDataFile implements RandomAccessData {
}
public
RandomAccessFile
acquire
()
throws
IOException
{
try
{
this
.
available
.
acquire
();
RandomAccessFile
file
=
this
.
files
.
poll
();
return
(
file
==
null
?
new
RandomAccessFile
(
RandomAccessDataFile
.
this
.
file
,
"r"
)
:
file
);
}
catch
(
InterruptedException
ex
)
{
Thread
.
currentThread
().
interrupt
();
throw
new
IOException
(
ex
);
}
this
.
available
.
acquireUninterruptibly
();
RandomAccessFile
file
=
this
.
files
.
poll
();
return
(
file
==
null
?
new
RandomAccessFile
(
RandomAccessDataFile
.
this
.
file
,
"r"
)
:
file
);
}
public
void
release
(
RandomAccessFile
file
)
{
...
...
@@ -263,22 +256,16 @@ public class RandomAccessDataFile implements RandomAccessData {
}
public
void
close
()
throws
IOException
{
this
.
available
.
acquireUninterruptibly
(
this
.
size
);
try
{
this
.
available
.
acquire
(
this
.
size
);
try
{
RandomAccessFile
file
=
this
.
files
.
poll
();
while
(
file
!=
null
)
{
file
.
close
();
file
=
this
.
files
.
poll
();
}
}
finally
{
this
.
available
.
release
(
this
.
size
);
RandomAccessFile
file
=
this
.
files
.
poll
();
while
(
file
!=
null
)
{
file
.
close
();
file
=
this
.
files
.
poll
();
}
}
catch
(
InterruptedException
ex
)
{
Thread
.
currentThread
().
interrupt
();
throw
new
IOException
(
ex
);
finally
{
this
.
available
.
release
(
this
.
size
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment