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

Side by Side Diff: Source/platform/TaskSynchronizer.cpp

Issue 593423002: Revert of DatabaseBackend should not post a task to an already terminated database thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/TaskSynchronizer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2013 Apple 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 17 matching lines...) Expand all
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "platform/TaskSynchronizer.h" 30 #include "platform/TaskSynchronizer.h"
31 31
32 #include "heap/ThreadState.h" 32 #include "heap/ThreadState.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 TaskSynchronizer::TaskSynchronizer() 36 TaskSynchronizer::TaskSynchronizer()
37 : m_taskCompleted(false) 37 : m_taskCompleted(false)
38 #if ENABLE(ASSERT)
39 , m_hasCheckedForTermination(false)
40 #endif
38 { 41 {
39 } 42 }
40 43
41 void TaskSynchronizer::waitForTaskCompletion() 44 void TaskSynchronizer::waitForTaskCompletion()
42 { 45 {
43 if (ThreadState::current()) { 46 if (ThreadState::current()) {
44 // Prevent the deadlock between park request by other threads and blocki ng 47 // Prevent the deadlock between park request by other threads and blocki ng
45 // by m_synchronousCondition. 48 // by m_synchronousCondition.
46 ThreadState::SafePointScope scope(ThreadState::HeapPointersOnStack); 49 ThreadState::SafePointScope scope(ThreadState::HeapPointersOnStack);
47 waitForTaskCompletionInternal(); 50 waitForTaskCompletionInternal();
(...skipping 13 matching lines...) Expand all
61 64
62 void TaskSynchronizer::taskCompleted() 65 void TaskSynchronizer::taskCompleted()
63 { 66 {
64 m_synchronousMutex.lock(); 67 m_synchronousMutex.lock();
65 m_taskCompleted = true; 68 m_taskCompleted = true;
66 m_synchronousCondition.signal(); 69 m_synchronousCondition.signal();
67 m_synchronousMutex.unlock(); 70 m_synchronousMutex.unlock();
68 } 71 }
69 72
70 } // namespace blink 73 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/TaskSynchronizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698