Index: base/barrier_closure.h |
diff --git a/base/barrier_closure.h b/base/barrier_closure.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..65cdd50567f804306fcbc3eef8f9e830d08af3d5 |
--- /dev/null |
+++ b/base/barrier_closure.h |
@@ -0,0 +1,24 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_BARRIER_CLOSURE_ |
awong
2013/08/22 21:28:33
BASE_BARRIER_CLOSURE_ -> BASE_BARRIER_CLOSURE_H_
groby-ooo-7-16
2013/08/22 21:59:45
Done.
|
+#define BASE_BARRIER_CLOSURE_ |
+ |
+#include "base/base_export.h" |
+#include "base/callback_forward.h" |
+ |
+namespace base { |
+ |
+// BarrierClosure executes |done_closure| after it has been invoked |
+// |num_closures| times. |
+// |
+// If |num_closures| is 0, |done_closure| is executed immediately. |
+// |
+// BarrierClosure is thread-safe - the count of remaining closures is |
+// maintained as a base::AtomicRefCount. |
awong
2013/08/22 21:28:33
This should note the threading assumptions about w
groby-ooo-7-16
2013/08/22 21:59:45
Done.
|
+BASE_EXPORT base::Closure BarrierClosure(int num_closures, |
+ const base::Closure& done_closure); |
+ |
+} // base |
awong
2013/08/22 21:28:33
} // namesapce base
#endif // BASE_BARRIER_CLOS
groby-ooo-7-16
2013/08/22 21:59:45
Done.
|
+#endif // BASE_BARRIER_CLOSURE_ |