Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
3765:ae5b2f1dcf12 | 3767:2a241e764894 |
---|---|
81 volatile unsigned int* dest, unsigned int compare_value) { | 81 volatile unsigned int* dest, unsigned int compare_value) { |
82 assert(sizeof(unsigned int) == sizeof(jint), "more work to do"); | 82 assert(sizeof(unsigned int) == sizeof(jint), "more work to do"); |
83 return (unsigned int)Atomic::cmpxchg((jint)exchange_value, (volatile jint*)dest, | 83 return (unsigned int)Atomic::cmpxchg((jint)exchange_value, (volatile jint*)dest, |
84 (jint)compare_value); | 84 (jint)compare_value); |
85 } | 85 } |
86 | |
87 jlong Atomic::add(jlong add_value, volatile jlong* dest) { | |
88 jlong old = load(dest); | |
89 jlong new_value = old + add_value; | |
90 while (old != cmpxchg(new_value, dest, old)) { | |
91 old = load(dest); | |
92 new_value = old + add_value; | |
93 } | |
94 return old; | |
95 } |