Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: ppapi/tests/test_case.cc

Issue 547543002: Fix potential race-condition _beginthread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ppapi/tests/pp_thread.h ('k') | ppapi/tests/test_post_message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ppapi/tests/test_case.h" 5 #include "ppapi/tests/test_case.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <sstream> 10 #include <sstream>
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void TestCase::DoQuitMainMessageLoop(void* pp_instance, int32_t result) { 244 void TestCase::DoQuitMainMessageLoop(void* pp_instance, int32_t result) {
245 PP_Instance* instance = static_cast<PP_Instance*>(pp_instance); 245 PP_Instance* instance = static_cast<PP_Instance*>(pp_instance);
246 GetTestingInterface()->QuitMessageLoop(*instance); 246 GetTestingInterface()->QuitMessageLoop(*instance);
247 delete instance; 247 delete instance;
248 } 248 }
249 249
250 void TestCase::RunOnThreadInternal( 250 void TestCase::RunOnThreadInternal(
251 void (*thread_func)(void*), 251 void (*thread_func)(void*),
252 void* thread_param, 252 void* thread_param,
253 const PPB_Testing_Private* testing_interface) { 253 const PPB_Testing_Private* testing_interface) {
254 PP_ThreadType thread; 254 PP_Thread thread;
255 PP_CreateThread(&thread, thread_func, thread_param); 255 PP_CreateThread(&thread, thread_func, thread_param);
256 // Run a message loop so pepper calls can be dispatched. The background 256 // Run a message loop so pepper calls can be dispatched. The background
257 // thread will set result_ and make us Quit when it's done. 257 // thread will set result_ and make us Quit when it's done.
258 testing_interface->RunMessageLoop(instance_->pp_instance()); 258 testing_interface->RunMessageLoop(instance_->pp_instance());
259 PP_JoinThread(thread); 259 PP_JoinThread(thread);
260 } 260 }
OLDNEW
« no previous file with comments | « ppapi/tests/pp_thread.h ('k') | ppapi/tests/test_post_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698