Mercurial > hg > truffle
diff src/share/vm/runtime/atomic.cpp @ 3767:2a241e764894
6941923: RFE: Handling large log files produced by long running Java Applications
Summary: supply optinal flags to realize gc log rotation
Reviewed-by: ysr, jwilhelm
author | minqi |
---|---|
date | Fri, 10 Jun 2011 15:08:36 -0700 |
parents | f95d63e2154a |
children | 7d9e451f5416 |
line wrap: on
line diff
--- a/src/share/vm/runtime/atomic.cpp Wed Jun 08 21:48:38 2011 -0400 +++ b/src/share/vm/runtime/atomic.cpp Fri Jun 10 15:08:36 2011 -0700 @@ -83,3 +83,13 @@ return (unsigned int)Atomic::cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value); } + +jlong Atomic::add(jlong add_value, volatile jlong* dest) { + jlong old = load(dest); + jlong new_value = old + add_value; + while (old != cmpxchg(new_value, dest, old)) { + old = load(dest); + new_value = old + add_value; + } + return old; +}