Skip to content

Commit

Permalink
Added source jar generator
Browse files Browse the repository at this point in the history
  • Loading branch information
stanbrub committed Oct 18, 2024
1 parent 58d5432 commit e06988e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
36 changes: 35 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,41 @@
</executions>
</plugin>
<plugin>
<!-- For spotless to work on Windows, Set git config global 'core.autocrlf' to true -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>install</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<excludePackageNames>*.connect,*.controller,*.generator,*.jfr,*.metric,*.run,*.util</excludePackageNames>
<show>public</show>
<nohelp>true</nohelp>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>install</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- For spotless to work on Windows, Set git config global
'core.autocrlf' to true -->
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/io/deephaven/benchmark/util/Threads.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

/**
* Provide help for using threads
*/
public class Threads {

/**
* Make a named <code>ExecutorService</code> that uses a single thread
*
* @param threadName the thread name
* @return an <code>ExecutorService</code> service with one thread
*/
static public ExecutorService single(String threadName) {
return Executors.newSingleThreadExecutor(new ThreadFactory() {
@Override
Expand All @@ -16,6 +25,11 @@ public Thread newThread(Runnable r) {
});
}

/**
* Pause the current thread of the given amount of milliseconds
*
* @param millis how long in millis to pause
*/
static public void sleep(long millis) {
try {
Thread.sleep(millis);
Expand Down

0 comments on commit e06988e

Please sign in to comment.