Skip to content

Commit

Permalink
added thread group back
Browse files Browse the repository at this point in the history
  • Loading branch information
firaja committed May 1, 2024
1 parent f80271d commit bcdeb53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/password4j/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class Utils
private static final AtomicInteger THREAD_COUNTER = new AtomicInteger(1);
private static final Pattern STRONG_PATTERN = Pattern.compile("\\s*([\\S&&[^:,]]*)(\\:([\\S&&[^,]]*))?\\s*(\\,(.*))?");

private static final ThreadGroup THREAD_GROUP = new ThreadGroup("Password4j Workers");

static
{
Arrays.fill(FROM_BASE64, -1);
Expand Down Expand Up @@ -621,7 +623,7 @@ static void printBanner(PrintStream printStream)
String banner = "\n";
banner += " |\n" +
" | \033[0;1mPassword4j\033[0;0m\n" +
" + \\ .: v1.8.1 :.\n" +
" + \\ .: v1.8.2 :.\n" +
" \\\\.G_.*=.\n" +
" `(H'/.\\| ✅ Argon2\n" +
" .>' (_--. ✅ scrypt\n" +
Expand Down Expand Up @@ -662,7 +664,7 @@ static List<byte[]> split(byte[] array, byte delimiter)
static ExecutorService createExecutorService()
{
return Executors.newFixedThreadPool(AVAILABLE_PROCESSORS, runnable -> {
Thread thread = new Thread(runnable, "password4j-worker-" + THREAD_COUNTER.getAndIncrement());
Thread thread = new Thread(THREAD_GROUP, runnable, "password4j-worker-" + THREAD_COUNTER.getAndIncrement());
thread.setDaemon(true);
return thread;
});
Expand Down

0 comments on commit bcdeb53

Please sign in to comment.