Skip to content

Commit

Permalink
8298057: (fs) Remove PollingWatchService.POLLING_INIT_DELAY
Browse files Browse the repository at this point in the history
Reviewed-by: bpb, jpai
  • Loading branch information
Alan Bateman committed Dec 6, 2022
1 parent 0bd04a6 commit 923c746
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/java.base/share/classes/sun/nio/fs/PollingWatchService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -61,9 +61,7 @@
class PollingWatchService
extends AbstractWatchService
{
// Wait between polling thread creation and first poll (seconds)
private static final int POLLING_INIT_DELAY = 1;
// Default time between polls (seconds)
// default polling interval in seconds
private static final int DEFAULT_POLLING_INTERVAL = 2;

// map of registrations
Expand Down Expand Up @@ -252,7 +250,6 @@ void update(long lastModified, int tickCount) {
* directory and queue keys when entries are added, modified, or deleted.
*/
private class PollingWatchKey extends AbstractWatchKey {

private final Object fileKey;

// current event set
Expand Down Expand Up @@ -311,10 +308,10 @@ void enable(Set<? extends WatchEvent.Kind<?>> events, long period) {
// update the events
this.events = events;

// create the periodic task with initialDelay set to the specified constant
// create the periodic task to poll directories
Runnable thunk = new Runnable() { public void run() { poll(); }};
this.poller = scheduledExecutor
.scheduleAtFixedRate(thunk, POLLING_INIT_DELAY, period, TimeUnit.SECONDS);
.scheduleAtFixedRate(thunk, period, period, TimeUnit.SECONDS);
}
}

Expand Down

1 comment on commit 923c746

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.