package com.perforce.hws.util; import java.util.function.BooleanSupplier; /** * Helper methods related to synchronizing multiple (external) processes or threads. */ public interface TimingHelpers { default boolean waitFor(int retries, int sleep, BooleanSupplier booleanSupplier) { try { while (0 < retries && !booleanSupplier.getAsBoolean()) { Thread.sleep(sleep); retries--; } return booleanSupplier.getAsBoolean(); } catch (InterruptedException interrupt) { throw new RuntimeException(interrupt); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19535 | drobins | Refactor package names to hws | ||
//guest/perforce_software/helix-web-services/main/source/jdk_extensions/src/main/java/com/perforce/helix_web_services/jdk_extensions/TimingHelpers.java | |||||
#1 | 19380 | tjuricek |
Adjust post-install config to handle upgrades better, and a test for debian systems. - Our default config file has an invalid line to flag that the file has never been touched. It's removed on the first post-install config. - We guard against overwriting things the next times post-install config is run, like the keystore files. - There's a "media" setting in the install4j configuration to treat "never override" as config files, which avoid overwriting the config (finally found it), at least on debian. - Added a new test suite just to ensure the configuration file is not overwritten, only works for .debs at the moment |