Skip to content

Commit

Permalink
schedule start in one thread instead of one service per thread
Browse files Browse the repository at this point in the history
  • Loading branch information
jinliu9508 committed Jun 20, 2024
1 parent e7353a2 commit a5e935f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ class ServiceProvider(

// schedule to start all startable services separate threads
fun scheduleStartServices() {
synchronized(serviceMap) {
val provider = this
for (serviceReg in serviceMap!![IStartableService::class.java]!!) {
coroutineScope.launch {
val provider = this
coroutineScope.launch {
synchronized(serviceMap) {
for (serviceReg in serviceMap!![IStartableService::class.java]!!) {
val service = serviceReg.resolve(provider) as IStartableService
service.start()
}
Expand Down

0 comments on commit a5e935f

Please sign in to comment.