Skip to content

Commit e9c3dc4

Browse files
committed
Sonarqube: Either re-interrupt this method or rethrow the "InterruptedException"
1 parent 341314f commit e9c3dc4

File tree

2 files changed

+3
-0
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/thread

2 files changed

+3
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/thread/PLock.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ protected boolean acquireBlocking() {
6868
semaphore.acquire();
6969
return true;
7070
} catch (InterruptedException e) {
71+
Thread.currentThread().interrupt();
7172
return false;
7273
}
7374
}
@@ -78,6 +79,7 @@ protected boolean acquireTimeout(long timeout) {
7879
try {
7980
return semaphore.tryAcquire(timeout, TimeUnit.MILLISECONDS);
8081
} catch (InterruptedException e) {
82+
Thread.currentThread().interrupt();
8183
return false;
8284
}
8385
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/thread/PRLock.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ protected boolean acquireTimeout(long timeout) {
104104
try {
105105
return lock.tryLock(timeout, TimeUnit.MILLISECONDS);
106106
} catch (InterruptedException e) {
107+
Thread.currentThread().interrupt();
107108
return false;
108109
}
109110
}

0 commit comments

Comments
 (0)