add a missing lock around allocGroup()
authorSimon Marlow <marlowsd@gmail.com>
Thu, 3 Dec 2009 11:02:09 +0000 (11:02 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 3 Dec 2009 11:02:09 +0000 (11:02 +0000)
rts/sm/Storage.c

index 0f74893..94f9e10 100644 (file)
@@ -631,7 +631,9 @@ allocate (Capability *cap, lnat n)
 
         stp = &nurseries[cap->no];
 
 
         stp = &nurseries[cap->no];
 
+        ACQUIRE_SM_LOCK
        bd = allocGroup(req_blocks);
        bd = allocGroup(req_blocks);
+        RELEASE_SM_LOCK;
        dbl_link_onto(bd, &stp->large_objects);
        stp->n_large_blocks += bd->blocks; // might be larger than req_blocks
         initBdescr(bd, stp);
        dbl_link_onto(bd, &stp->large_objects);
        stp->n_large_blocks += bd->blocks; // might be larger than req_blocks
         initBdescr(bd, stp);