OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h" |
| 6 |
| 7 #include "base/synchronization/waitable_event.h" |
| 8 |
| 9 namespace ui { |
| 10 |
| 11 namespace { |
| 12 |
| 13 void OnRunPostedTaskAndSignal(const base::Closure& callback, |
| 14 base::WaitableEvent* wait) { |
| 15 callback.Run(); |
| 16 wait->Signal(); |
| 17 } |
| 18 |
| 19 } // namespace |
| 20 |
| 21 void PostSyncTask( |
| 22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 23 const base::Closure& callback) { |
| 24 base::WaitableEvent wait(false, false); |
| 25 bool success = task_runner->PostTask( |
| 26 FROM_HERE, base::Bind(OnRunPostedTaskAndSignal, callback, &wait)); |
| 27 if (success) |
| 28 wait.Wait(); |
| 29 } |
| 30 |
| 31 } // namespace ui |
OLD | NEW |