32 size_t compare_value; |
32 size_t compare_value; |
33 size_t exchange_value; |
33 size_t exchange_value; |
34 do { |
34 do { |
35 compare_value = *dest; |
35 compare_value = *dest; |
36 exchange_value = compare_value + value; |
36 exchange_value = compare_value + value; |
37 } while (Atomic::cmpxchg(exchange_value, dest, compare_value) != compare_value); |
37 } while (Atomic::cmpxchg(dest, compare_value, exchange_value) != compare_value); |
38 return exchange_value; |
38 return exchange_value; |
39 } |
39 } |
40 |
40 |
41 static jlong atomic_dec(size_t volatile* const dest) { |
41 static jlong atomic_dec(size_t volatile* const dest) { |
42 size_t compare_value; |
42 size_t compare_value; |
43 size_t exchange_value; |
43 size_t exchange_value; |
44 do { |
44 do { |
45 compare_value = *dest; |
45 compare_value = *dest; |
46 assert(compare_value >= 1, "invariant"); |
46 assert(compare_value >= 1, "invariant"); |
47 exchange_value = compare_value - 1; |
47 exchange_value = compare_value - 1; |
48 } while (Atomic::cmpxchg(exchange_value, dest, compare_value) != compare_value); |
48 } while (Atomic::cmpxchg(dest, compare_value, exchange_value) != compare_value); |
49 return exchange_value; |
49 return exchange_value; |
50 } |
50 } |
51 |
51 |
52 const size_t max_lease_factor = 2; |
52 const size_t max_lease_factor = 2; |
53 JfrStorageControl::JfrStorageControl(size_t global_count_total, size_t in_memory_discard_threshold) : |
53 JfrStorageControl::JfrStorageControl(size_t global_count_total, size_t in_memory_discard_threshold) : |