diff options
-rw-r--r-- | rts/Capability.c | 1 | ||||
-rw-r--r-- | rts/Schedule.c | 4 | ||||
-rw-r--r-- | rts/Sparks.c | 10 | ||||
-rw-r--r-- | rts/Sparks.h | 2 |
4 files changed, 5 insertions, 12 deletions
diff --git a/rts/Capability.c b/rts/Capability.c index 410d3d0a9c..d8c3b2d53c 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -232,6 +232,7 @@ initCapability( Capability *cap, nat i ) cap->returning_tasks_hd = NULL; cap->returning_tasks_tl = NULL; cap->inbox = (Message*)END_TSO_QUEUE; + cap->sparks = allocSparkPool(); cap->spark_stats.created = 0; cap->spark_stats.dud = 0; cap->spark_stats.overflowed = 0; diff --git a/rts/Schedule.c b/rts/Schedule.c index 5c94e20126..222220053a 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -2010,10 +2010,6 @@ initScheduler(void) initTaskManager(); -#if defined(THREADED_RTS) - initSparkPools(); -#endif - RELEASE_LOCK(&sched_mutex); #if defined(THREADED_RTS) diff --git a/rts/Sparks.c b/rts/Sparks.c index 26b8199035..6ce2e68094 100644 --- a/rts/Sparks.c +++ b/rts/Sparks.c @@ -17,14 +17,10 @@ #if defined(THREADED_RTS) -void -initSparkPools( void ) +SparkPool * +allocSparkPool( void ) { - /* walk over the capabilities, allocating a spark pool for each one */ - nat i; - for (i = 0; i < n_capabilities; i++) { - capabilities[i].sparks = newWSDeque(RtsFlags.ParFlags.maxLocalSparks); - } + return newWSDeque(RtsFlags.ParFlags.maxLocalSparks); } void diff --git a/rts/Sparks.h b/rts/Sparks.h index 7db60186c3..e381dd540f 100644 --- a/rts/Sparks.h +++ b/rts/Sparks.h @@ -30,7 +30,7 @@ typedef struct { typedef WSDeque SparkPool; // Initialisation -void initSparkPools (void); +SparkPool *allocSparkPool (void); // Take a spark from the "write" end of the pool. Can be called // by the pool owner only. |