Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.mojo.system; | |
| 6 | |
| 7 import org.chromium.mojo.system.Core.WaitFlags; | |
| 8 | |
| 9 /** | |
| 10 * Help classes allowing asynchronously calling wait on a background thread, and pass the result to | |
|
bulach
2014/05/15 19:32:58
nit: the callback has also an error condition, so
rmcilroy
2014/05/15 22:36:51
Most of this is describes the asyncWait method. I
qsr
2014/05/19 12:12:09
Done.
| |
| 11 * the given {@link AsyncWaiterCallback} on the current thread. Returns a {@link Cancellable} object | |
| 12 * that can be used to stop waiting. This object becomes invalid once the callba ck runs. | |
| 13 */ | |
| 14 public interface AsyncWaiter { | |
| 15 | |
| 16 /** | |
| 17 * Allow to stop waiting. | |
|
rmcilroy
2014/05/15 22:36:51
Allows cancelation of an asyncWait operation.
qsr
2014/05/19 12:12:09
Done.
| |
| 18 */ | |
| 19 interface Cancellable { | |
| 20 /** | |
| 21 * Stop waiting. Has no effect if the callback has already been called. Must be called from | |
|
rmcilroy
2014/05/15 22:36:51
Cancels an asyncWait operation. Has no effect if
qsr
2014/05/19 12:12:09
Done.
| |
| 22 * the same thread {@link AsyncWaiter#asyncWait(Handle, WaitFlags, long, | |
| 23 * AsyncWaiterCallback)} has been called. | |
| 24 */ | |
| 25 void cancel(); | |
| 26 } | |
| 27 | |
| 28 /** | |
| 29 * Asynchronously call wait on a background thread, and pass the result of w ait to the given | |
| 30 * callback on the current thread. | |
|
rmcilroy
2014/05/15 22:36:51
Asynchronously call wait on a background thread.
qsr
2014/05/19 12:12:09
Done.
| |
| 31 */ | |
| 32 Cancellable asyncWait(Handle handle, | |
| 33 WaitFlags flags, long deadline, | |
| 34 AsyncWaiterCallback callback); | |
| 35 | |
| 36 } | |
| OLD | NEW |