Skip to content

Commit cee5880

Browse files
committed
---
yaml --- r: 31605 b: refs/heads/dist-snap c: ce6d651 h: refs/heads/master i: 31603: 22852c5 v: v3
1 parent a534283 commit cee5880

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: f76a46242b6a34ac09643ddf4050be9d1ad11573
10+
refs/heads/dist-snap: ce6d6511c7fb7f82d2890de578ef9bb28e410281
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rt/rust_sched_driver.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ void
2222
rust_sched_driver::start_main_loop() {
2323
assert(sched_loop != NULL);
2424

25+
#ifdef __APPLE__
26+
{
27+
char buf[64];
28+
snprintf(buf, sizeof(buf), "scheduler loop %d", sched_loop->get_id());
29+
// pthread_setname_np seems to have a different signature and
30+
// different behavior on different platforms. Thus, this is
31+
// only for Mac at the moment. There are equivalent versions
32+
// for Linux that we can add if needed.
33+
pthread_setname_np(buf);
34+
}
35+
#endif
36+
2537
rust_sched_loop_state state = sched_loop_state_keep_going;
2638
while (state != sched_loop_state_exit) {
2739
DLOG(sched_loop, dom, "pumping scheduler");

branches/dist-snap/src/rt/rust_sched_loop.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ struct rust_sched_loop
130130
// Called by tasks when they need a stack on which to run C code
131131
stk_seg *borrow_c_stack();
132132
void return_c_stack(stk_seg *stack);
133+
134+
int get_id() { return this->id; }
133135
};
134136

135137
inline rust_log &

0 commit comments

Comments
 (0)