Skip to content

Commit baf073f

Browse files
committed
merge conflicts
1 parent 23d9ce9 commit baf073f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryDatabaseMetaData.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5278,7 +5278,7 @@ static Future<?>[] wrapThread(final Thread thread) {
52785278
private volatile boolean cancelled = false;
52795279

52805280
@Override
5281-
public boolean cancel(boolean mayInterruptIfRunning) {
5281+
public synchronized boolean cancel(boolean mayInterruptIfRunning) {
52825282
if (cancelled || thread.getState() == Thread.State.TERMINATED) {
52835283
return false;
52845284
}
@@ -5336,7 +5336,13 @@ public Object get(long timeout, TimeUnit unit)
53365336
if (remainingMillis <= 0) {
53375337
remainingMillis = 1;
53385338
}
5339-
thread.join(Math.min(remainingMillis, 50));
5339+
5340+
long delay = Math.min(remainingMillis, 50);
5341+
if (thread.getState() == Thread.State.NEW) {
5342+
Thread.sleep(delay);
5343+
} else {
5344+
thread.join(delay);
5345+
}
53405346
remainingNanos = deadline - System.nanoTime();
53415347
}
53425348
return null;

0 commit comments

Comments
 (0)