@@ -78,7 +78,7 @@ public JfrThrottler() {
7878 */
7979 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
8080 private void normalize (long samplesPerPeriod , double periodMs ) {
81- assert rwlock .isWriteOwner ();
81+ assert rwlock .isCurrentThreadWriteOwner ();
8282 // Do we want more than 10samples/s ? If so convert to samples/s
8383 double periodsPerSecond = 1000.0 / periodMs ;
8484 double samplesPerSecond = samplesPerPeriod * periodsPerSecond ;
@@ -157,20 +157,20 @@ public boolean sample() {
157157 */
158158 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
159159 private void rotateWindow () {
160- assert rwlock .isWriteOwner ();
160+ assert rwlock .isCurrentThreadWriteOwner ();
161161 configure ();
162162 installNextWindow ();
163163 }
164164
165165 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
166166 private void installNextWindow () {
167- assert rwlock .isWriteOwner ();
167+ assert rwlock .isCurrentThreadWriteOwner ();
168168 activeWindow = getNextWindow ();
169169 }
170170
171171 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
172172 private JfrThrottlerWindow getNextWindow () {
173- assert rwlock .isWriteOwner ();
173+ assert rwlock .isCurrentThreadWriteOwner ();
174174 if (window0 == activeWindow ) {
175175 return window1 ;
176176 }
@@ -179,7 +179,7 @@ private JfrThrottlerWindow getNextWindow() {
179179
180180 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
181181 private long computeAccumulatedDebtCarryLimit (long windowDurationNs ) {
182- assert rwlock .isWriteOwner ();
182+ assert rwlock .isCurrentThreadWriteOwner ();
183183 if (periodNs == 0 || windowDurationNs >= TimeUtils .nanosPerSecond ) {
184184 return 1 ;
185185 }
@@ -188,7 +188,7 @@ private long computeAccumulatedDebtCarryLimit(long windowDurationNs) {
188188
189189 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
190190 private long amortizeDebt (JfrThrottlerWindow lastWindow ) {
191- assert rwlock .isWriteOwner ();
191+ assert rwlock .isCurrentThreadWriteOwner ();
192192 if (accumulatedDebtCarryCount == accumulatedDebtCarryLimit ) {
193193 accumulatedDebtCarryCount = 1 ;
194194 return 0 ; // reset because new settings have been applied
@@ -203,7 +203,7 @@ private long amortizeDebt(JfrThrottlerWindow lastWindow) {
203203 */
204204 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
205205 private void setSamplePointsAndWindowDuration () {
206- assert rwlock .isWriteOwner ();
206+ assert rwlock .isCurrentThreadWriteOwner ();
207207 assert reconfigure ;
208208 JfrThrottlerWindow next = getNextWindow ();
209209 long samplesPerWindow = eventSampleSize / WINDOW_DIVISOR ;
@@ -224,7 +224,7 @@ private void setSamplePointsAndWindowDuration() {
224224
225225 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
226226 private void configure () {
227- assert rwlock .isWriteOwner ();
227+ assert rwlock .isCurrentThreadWriteOwner ();
228228 JfrThrottlerWindow next = getNextWindow ();
229229
230230 // Store updated parameters to both windows.
@@ -257,7 +257,7 @@ protected static double windowLookback(JfrThrottlerWindow window) {
257257
258258 @ Uninterruptible (reason = "Called from uninterruptible code." , mayBeInlined = true )
259259 private double projectPopulationSize (long lastWindowMeasuredPop ) {
260- assert rwlock .isWriteOwner ();
260+ assert rwlock .isCurrentThreadWriteOwner ();
261261 avgPopulationSize = exponentiallyWeightedMovingAverage (lastWindowMeasuredPop , ewmaPopulationSizeAlpha , avgPopulationSize );
262262 return avgPopulationSize ;
263263 }
0 commit comments