summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2014-10-10 14:26:19 +0100
committerSimon Marlow <marlowsd@gmail.com>2014-10-10 14:31:59 +0100
commit674c631ea111233daa929ef63500d75ba0db8858 (patch)
treedb42f94960c86876b73785f2c1946aeff871308e /rts/sm
parentd3f56ec6a6ead847233fee5dfad7979c2d63fc3d (diff)
downloadhaskell-674c631ea111233daa929ef63500d75ba0db8858.tar.gz
Name worker threads using pthread_setname_np
This helps identify threads in gdb particularly in processes with a lot of threads.
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/GC.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index dabcd722d7..19d9ab23bc 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -670,6 +670,15 @@ GarbageCollect (nat collect_gen,
if (major_gc) { gcCAFs(); }
#endif
+ // Update the stable pointer hash table.
+ updateStableTables(major_gc);
+
+ // unlock the StablePtr table. Must be before scheduleFinalizers(),
+ // because a finalizer may call hs_free_fun_ptr() or
+ // hs_free_stable_ptr(), both of which access the StablePtr table.
+ stableUnlock();
+
+ // Must be after stableUnlock(), because it might free stable ptrs.
if (major_gc) {
checkUnload (gct->scavenged_static_objects);
}
@@ -696,14 +705,6 @@ GarbageCollect (nat collect_gen,
}
}
- // Update the stable pointer hash table.
- updateStableTables(major_gc);
-
- // unlock the StablePtr table. Must be before scheduleFinalizers(),
- // because a finalizer may call hs_free_fun_ptr() or
- // hs_free_stable_ptr(), both of which access the StablePtr table.
- stableUnlock();
-
// Start any pending finalizers. Must be after
// updateStableTables() and stableUnlock() (see #4221).
RELEASE_SM_LOCK;