| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 void HRTFDatabaseLoader::waitForLoaderThreadCompletion() | 114 void HRTFDatabaseLoader::waitForLoaderThreadCompletion() |
| 115 { | 115 { |
| 116 if (!m_thread) | 116 if (!m_thread) |
| 117 return; | 117 return; |
| 118 | 118 |
| 119 TaskSynchronizer sync; | 119 TaskSynchronizer sync; |
| 120 // TODO(alexclarke): Should this be posted as a loading task? | 120 // TODO(alexclarke): Should this be posted as a loading task? |
| 121 m_thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&HRTF
DatabaseLoader::cleanupTask, AllowCrossThreadAccess(this), AllowCrossThreadAcces
s(&sync))); | 121 m_thread->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&HRTF
DatabaseLoader::cleanupTask, AllowCrossThreadAccess(this), AllowCrossThreadAcces
s(&sync))); |
| 122 sync.waitForTaskCompletion(); | 122 sync.waitForTaskCompletion(); |
| 123 m_thread.clear(); | 123 m_thread.reset(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| OLD | NEW |