fix closed groups & clean

This commit is contained in:
Ryan ZHAO
2021-01-29 11:08:48 +11:00
parent 13f94c2cfd
commit 3b50b8f40b
51 changed files with 96 additions and 217 deletions

View File

@@ -59,7 +59,6 @@ public class Hex {
}
private static void appendHexChar(StringBuffer buf, int b) {
buf.append("(byte)0x");
buf.append(HEX_DIGITS[(b >> 4) & 0xf]);
buf.append(HEX_DIGITS[b & 0xf]);
}

View File

@@ -1,18 +1,26 @@
package org.session.libsignal.service.loki.utilities
import java.util.concurrent.Executors
import java.util.concurrent.*
object ThreadUtils {
internal val executorPool = Executors.newCachedThreadPool()
val executorPool = Executors.newCachedThreadPool()
@JvmStatic
fun queue(target: Runnable) {
executorPool.execute(target)
}
fun queue(target: ()->Unit) {
fun queue(target: () -> Unit) {
executorPool.execute(target)
}
@JvmStatic
fun newDynamicSingleThreadedExecutor(): ExecutorService {
val executor = ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS,
LinkedBlockingQueue())
executor.allowCoreThreadTimeOut(true)
return executor
}
}