Skip to content

Commit ab42693

Browse files
committed
use newScheduledThreadPool()
1 parent 4b81569 commit ab42693

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core-kotlin-modules/core-kotlin-concurrency-3/src/main/java/com/baeldung/schedulingrepeatingtask/UsingScheduledThreadPool.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import java.util.concurrent.Executors
44
import java.util.concurrent.TimeUnit
55

66
fun main(){
7-
val scheduler = Executors.newSingleThreadScheduledExecutor()
7+
val scheduler = Executors.newScheduledThreadPool(1)
88
scheduler.scheduleAtFixedRate({
99
println("Complex task completed!")
1010
}, 0, 1, TimeUnit.SECONDS)

0 commit comments

Comments
 (0)