New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loom support. #1176
Loom support. #1176
Conversation
@swankjesse Are there any benchmarks we can test
|
TODO
|
@@ -253,7 +259,7 @@ open class AsyncTimeout : Timeout() { | |||
prev.next = node | |||
if (prev === head) { | |||
// Wake up the watchdog when inserting at the front. | |||
(AsyncTimeout::class.java as Object).notify() | |||
condition.signal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
while (true) { | ||
val now = System.nanoTime() | ||
val byteCountOrWaitNanos = byteCountOrWaitNanos(now, byteCount) | ||
if (byteCountOrWaitNanos >= 0) return byteCountOrWaitNanos | ||
waitNanos(-byteCountOrWaitNanos) | ||
} | ||
} | ||
throw AssertionError() // Unreachable, but synchronized() doesn't know that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love where you’re going with this.
Please take the next steps:
- replace
synchronized
withwithLock
- tests for the function on Timeout
import java.util.concurrent.ScheduledExecutorService | ||
import java.util.concurrent.ThreadFactory | ||
|
||
object TestingExecutors { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is rad
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Towards #1169
For discussion
General approach from