Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8297173: usageTicks and totalTicks should be volatile to ensure that different threads get the latest ticks #11199

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -49,8 +49,8 @@ class OperatingSystemImpl extends BaseOperatingSystemImpl
private ContainerCpuTicks processLoadTicks = new ProcessCpuTicks();

private abstract class ContainerCpuTicks {
private long usageTicks = 0;
private long totalTicks = 0;
private volatile long usageTicks = 0;
private volatile long totalTicks = 0;
tianshuang marked this conversation as resolved.
Show resolved Hide resolved

private double getUsageDividesTotal(long usageTicks, long totalTicks) {
// If cpu quota or cpu shares are in effect. Calculate the cpu load
Expand Down