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

Unified Diff: base/atomic_ref_count.h

Issue 8588036: Improve support for multiselect list box accessibility on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/base.gyp » ('j') | base/win/enum_variant.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/atomic_ref_count.h
===================================================================
--- base/atomic_ref_count.h (revision 111700)
+++ base/atomic_ref_count.h (working copy)
@@ -51,6 +51,24 @@
return base::AtomicRefCountDecN(ptr, 1);
}
+// Increment a reference count by 1 and return the new value.
+inline AtomicRefCount AtomicRefCountIncAndReturnValue(
+ volatile AtomicRefCount *ptr) {
+ ANNOTATE_HAPPENS_BEFORE(ptr);
+ AtomicRefCount res = subtle::Barrier_AtomicIncrement(ptr, 1);
+ ANNOTATE_HAPPENS_AFTER(ptr);
+ return res;
+}
+
+// Decrement a reference count by 1 and return the new value.
+inline AtomicRefCount AtomicRefCountDecAndReturnValue(
+ volatile AtomicRefCount *ptr) {
+ ANNOTATE_HAPPENS_BEFORE(ptr);
+ AtomicRefCount res = subtle::Barrier_AtomicIncrement(ptr, -1);
+ ANNOTATE_HAPPENS_AFTER(ptr);
+ return res;
+}
+
// Return whether the reference count is one. If the reference count is used
// in the conventional way, a refrerence count of 1 implies that the current
// thread owns the reference and no other thread shares it. This call performs
« no previous file with comments | « no previous file | base/base.gyp » ('j') | base/win/enum_variant.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698