OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_PUBLIC_C_ENVIRONMENT_ASYNC_WAITER_H_ | 5 #ifndef MOJO_PUBLIC_C_ENVIRONMENT_ASYNC_WAITER_H_ |
6 #define MOJO_PUBLIC_C_ENVIRONMENT_ASYNC_WAITER_H_ | 6 #define MOJO_PUBLIC_C_ENVIRONMENT_ASYNC_WAITER_H_ |
7 | 7 |
8 #include "mojo/public/c/system/handle.h" | 8 #include "mojo/public/c/system/handle.h" |
9 #include "mojo/public/c/system/result.h" | 9 #include "mojo/public/c/system/result.h" |
10 #include "mojo/public/c/system/types.h" | 10 #include "mojo/public/c/system/time.h" |
11 | 11 |
12 typedef uintptr_t MojoAsyncWaitID; | 12 typedef uintptr_t MojoAsyncWaitID; |
13 | 13 |
14 typedef void (*MojoAsyncWaitCallback)(void* closure, MojoResult result); | 14 typedef void (*MojoAsyncWaitCallback)(void* closure, MojoResult result); |
15 | 15 |
16 // Functions for asynchronously waiting (and cancelling asynchronous waits) on a | 16 // Functions for asynchronously waiting (and cancelling asynchronous waits) on a |
17 // handle. | 17 // handle. |
18 // | 18 // |
19 // Thread-safety: | 19 // Thread-safety: |
20 // - |CancelWait(wait_id)| may only be called on the same thread as the | 20 // - |CancelWait(wait_id)| may only be called on the same thread as the |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // | 58 // |
59 // Once this has been called, the callback provided to |AsyncWait()| will not | 59 // Once this has been called, the callback provided to |AsyncWait()| will not |
60 // be called. Moreover, it is then immediately safe to close or transfer the | 60 // be called. Moreover, it is then immediately safe to close or transfer the |
61 // handle provided to |AsyncWait()|. (I.e., the implementation of this | 61 // handle provided to |AsyncWait()|. (I.e., the implementation of this |
62 // |MojoAsyncWaiter| will no longer wait on, or do anything else with, the | 62 // |MojoAsyncWaiter| will no longer wait on, or do anything else with, the |
63 // handle.) | 63 // handle.) |
64 void (*CancelWait)(MojoAsyncWaitID wait_id); | 64 void (*CancelWait)(MojoAsyncWaitID wait_id); |
65 }; | 65 }; |
66 | 66 |
67 #endif // MOJO_PUBLIC_C_ENVIRONMENT_ASYNC_WAITER_H_ | 67 #endif // MOJO_PUBLIC_C_ENVIRONMENT_ASYNC_WAITER_H_ |
OLD | NEW |