Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: include/AdblockPlus/AsyncExecutor.h

Issue 29727558: Issue 6489 - fix initialization moment of the default scheduler of DefaultPlatformBuilder (Closed) Base URL: https://github.com/adblockplus/libadblockplus@cd1cd70ea3122fb4b8a96c40d96ce9b1ae5a3ae9
Left Patch Set: Created March 19, 2018, 10:17 a.m.
Right Patch Set: fix typo Created March 19, 2018, 12:33 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | include/AdblockPlus/Platform.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 */ 90 */
91 void Dispatch(const std::function<void()>& call) 91 void Dispatch(const std::function<void()>& call)
92 { 92 {
93 std::lock_guard<std::mutex> lock(asyncExecutorMutex); 93 std::lock_guard<std::mutex> lock(asyncExecutorMutex);
94 if (!executor) 94 if (!executor)
95 return; 95 return;
96 executor->Dispatch(call); 96 executor->Dispatch(call);
97 } 97 }
98 98
99 /** 99 /**
100 * Destroyes internally held `AsyncExecutor`, any subsequent calls of 100 * Destroys internally held `AsyncExecutor`, any subsequent calls of
hub 2018/03/19 11:48:43 nit: "Destroys"
sergei 2018/03/19 12:34:26 Done.
101 * `Dispatch` have no effect. 101 * `Dispatch` have no effect.
102 */ 102 */
103 void Invalidate() 103 void Invalidate()
104 { 104 {
105 std::unique_ptr<AsyncExecutor> tmp; 105 std::unique_ptr<AsyncExecutor> tmp;
106 { 106 {
107 std::lock_guard<std::mutex> lock(asyncExecutorMutex); 107 std::lock_guard<std::mutex> lock(asyncExecutorMutex);
108 tmp = move(executor); 108 tmp = move(executor);
109 } 109 }
110 } 110 }
111 private: 111 private:
112 std::mutex asyncExecutorMutex; 112 std::mutex asyncExecutorMutex;
113 std::unique_ptr<AsyncExecutor> executor; 113 std::unique_ptr<AsyncExecutor> executor;
114 }; 114 };
115 } 115 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld