Author: glebius
Date: Fri Dec  9 19:07:31 2016
New Revision: 309751
URL: https://svnweb.freebsd.org/changeset/base/309751

Log:
  Use acquire write to cr_lock to complement with release write at end
  of locked region.
  
  Submitted by: kib

Modified:
  head/sys/kern/subr_counter.c

Modified: head/sys/kern/subr_counter.c
==============================================================================
--- head/sys/kern/subr_counter.c        Fri Dec  9 18:55:27 2016        
(r309750)
+++ head/sys/kern/subr_counter.c        Fri Dec  9 19:07:31 2016        
(r309751)
@@ -144,7 +144,7 @@ counter_ratecheck(struct counter_rate *c
                 * First try unlocked read, and then proceed with atomic.
                 */
                if ((cr->cr_lock == 0) &&
-                   atomic_cmpset_int(&cr->cr_lock, 0, 1)) {
+                   atomic_cmpset_acq_int(&cr->cr_lock, 0, 1)) {
                        /*
                         * Check if other thread has just went through the
                         * reset sequence before us.
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to