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

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

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/modules/webdatabase/DatabaseThread.cpp ('k') | Source/platform/TaskSynchronizer.cpp » ('j') | 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 30 matching lines...) Expand all
41 WTF_MAKE_NONCOPYABLE(TaskSynchronizer); 41 WTF_MAKE_NONCOPYABLE(TaskSynchronizer);
42 public: 42 public:
43 TaskSynchronizer(); 43 TaskSynchronizer();
44 44
45 // Called from a thread that waits for the task completion. 45 // Called from a thread that waits for the task completion.
46 void waitForTaskCompletion(); 46 void waitForTaskCompletion();
47 47
48 // Called from a thread that executes the task. 48 // Called from a thread that executes the task.
49 void taskCompleted(); 49 void taskCompleted();
50 50
51 #if ENABLE(ASSERT)
52 bool hasCheckedForTermination() const { return m_hasCheckedForTermination; }
53 void setHasCheckedForTermination() { m_hasCheckedForTermination = true; }
54 #endif
55
51 private: 56 private:
52 void waitForTaskCompletionInternal(); 57 void waitForTaskCompletionInternal();
53 58
54 bool m_taskCompleted; 59 bool m_taskCompleted;
55 Mutex m_synchronousMutex; 60 Mutex m_synchronousMutex;
56 ThreadCondition m_synchronousCondition; 61 ThreadCondition m_synchronousCondition;
62 #if ENABLE(ASSERT)
63 bool m_hasCheckedForTermination;
64 #endif
57 }; 65 };
58 66
59 } // namespace blink 67 } // namespace blink
60 68
61 #endif // TaskSynchronizer_h 69 #endif // TaskSynchronizer_h
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/DatabaseThread.cpp ('k') | Source/platform/TaskSynchronizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698