Date: Sat, 17 Aug 2013 19:34:42 +0000 (UTC) From: Ed Maste <emaste@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254465 - head/sys/sys Message-ID: <201308171934.r7HJYgnw086725@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: emaste Date: Sat Aug 17 19:34:41 2013 New Revision: 254465 URL: http://svnweb.freebsd.org/changeset/base/254465 Log: Correct implementation of atomic_flag_test_and_set The function sets the flag and returns the previous value (7.17.8.1). Modified: head/sys/sys/stdatomic.h Modified: head/sys/sys/stdatomic.h ============================================================================== --- head/sys/sys/stdatomic.h Sat Aug 17 19:29:51 2013 (r254464) +++ head/sys/sys/stdatomic.h Sat Aug 17 19:34:41 2013 (r254465) @@ -381,11 +381,7 @@ static __inline _Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, memory_order __order) { - _Bool __expected; - - __expected = 0; - return (atomic_compare_exchange_strong_explicit(&__object->__flag, - &__expected, 1, __order, __order)); + return (atomic_exchange_explicit(&__object->__flag, 1, __order)); } static __inline void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308171934.r7HJYgnw086725>