File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
truffle/src/com.oracle.truffle.nfi.test/src/com/oracle/truffle/nfi/test Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ void setErrno(int e) throws InteropException {
97
97
}
98
98
}
99
99
100
+ private static final int TIMEOUT_MILLIS = 10000 ;
101
+
100
102
final class TestThreadRunnable implements Runnable {
101
103
102
104
private final int errno ;
@@ -120,8 +122,8 @@ void ensureSyncpoint() throws Throwable {
120
122
Throwable err = TruffleSafepoint .setBlockedThreadInterruptibleFunction (null , lockObject -> {
121
123
assert Thread .holdsLock (lockObject );
122
124
long currentTime ;
123
- while (error == null && !waiting && ((currentTime = System .currentTimeMillis ()) - waitStart ) < 1000 ) {
124
- lockObject .wait (1000 - (currentTime - waitStart ));
125
+ while (error == null && !waiting && ((currentTime = System .currentTimeMillis ()) - waitStart ) < TIMEOUT_MILLIS ) {
126
+ lockObject .wait (TIMEOUT_MILLIS - (currentTime - waitStart ));
125
127
}
126
128
return error ;
127
129
}, lock );
@@ -161,8 +163,8 @@ private void syncpoint() throws TimeoutException {
161
163
TruffleSafepoint .setBlockedThreadInterruptible (null , lockObject -> {
162
164
assert Thread .holdsLock (lockObject );
163
165
long currentTime ;
164
- while (waiting && ((currentTime = System .currentTimeMillis ()) - waitStart ) < 1000 ) {
165
- lockObject .wait (1000 - (currentTime - waitStart ));
166
+ while (waiting && ((currentTime = System .currentTimeMillis ()) - waitStart ) < TIMEOUT_MILLIS ) {
167
+ lockObject .wait (TIMEOUT_MILLIS - (currentTime - waitStart ));
166
168
}
167
169
if (!waiting && extraRunnable != null ) {
168
170
extraRunnable .run ();
You can’t perform that action at this time.
0 commit comments