| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EDK_SYSTEM_WAITER_TEST_UTILS_H_ | 5 #ifndef MOJO_EDK_SYSTEM_WAITER_TEST_UTILS_H_ |
| 6 #define MOJO_EDK_SYSTEM_WAITER_TEST_UTILS_H_ | 6 #define MOJO_EDK_SYSTEM_WAITER_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/threading/simple_thread.h" | 11 #include "base/threading/simple_thread.h" |
| 12 #include "mojo/edk/system/dispatcher.h" | 12 #include "mojo/edk/system/dispatcher.h" |
| 13 #include "mojo/edk/system/handle_signals_state.h" | 13 #include "mojo/edk/system/handle_signals_state.h" |
| 14 #include "mojo/edk/system/waiter.h" | 14 #include "mojo/edk/system/waiter.h" |
| 15 #include "mojo/public/c/system/types.h" | 15 #include "mojo/public/c/system/types.h" |
| 16 #include "mojo/public/cpp/system/macros.h" | 16 #include "mojo/public/cpp/system/macros.h" |
| 17 | 17 |
| 18 namespace mojo { | 18 namespace mojo { |
| 19 namespace system { | 19 namespace edk { |
| 20 namespace test { | 20 namespace test { |
| 21 | 21 |
| 22 // This is a very simple thread that has a |Waiter|, on which it waits | 22 // This is a very simple thread that has a |Waiter|, on which it waits |
| 23 // indefinitely (and records the result). It will create and initialize the | 23 // indefinitely (and records the result). It will create and initialize the |
| 24 // |Waiter| on creation, but the caller must start the thread with |Start()|. It | 24 // |Waiter| on creation, but the caller must start the thread with |Start()|. It |
| 25 // will join the thread on destruction. | 25 // will join the thread on destruction. |
| 26 // | 26 // |
| 27 // One usually uses it like: | 27 // One usually uses it like: |
| 28 // | 28 // |
| 29 // MojoResult result; | 29 // MojoResult result; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 MojoResult* const result_out_; | 91 MojoResult* const result_out_; |
| 92 uint32_t* const context_out_; | 92 uint32_t* const context_out_; |
| 93 HandleSignalsState* const signals_state_out_; | 93 HandleSignalsState* const signals_state_out_; |
| 94 | 94 |
| 95 Waiter waiter_; | 95 Waiter waiter_; |
| 96 | 96 |
| 97 MOJO_DISALLOW_COPY_AND_ASSIGN(WaiterThread); | 97 MOJO_DISALLOW_COPY_AND_ASSIGN(WaiterThread); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace test | 100 } // namespace test |
| 101 } // namespace system | 101 } // namespace edk |
| 102 } // namespace mojo | 102 } // namespace mojo |
| 103 | 103 |
| 104 #endif // MOJO_EDK_SYSTEM_WAITER_TEST_UTILS_H_ | 104 #endif // MOJO_EDK_SYSTEM_WAITER_TEST_UTILS_H_ |
| OLD | NEW |