Set thread name on Mac to make gdb thread info more useful.
This commit is contained in:
parent
f76a46242b
commit
ce6d6511c7
@ -22,6 +22,18 @@ void
|
||||
rust_sched_driver::start_main_loop() {
|
||||
assert(sched_loop != NULL);
|
||||
|
||||
#ifdef __APPLE__
|
||||
{
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), "scheduler loop %d", sched_loop->get_id());
|
||||
// pthread_setname_np seems to have a different signature and
|
||||
// different behavior on different platforms. Thus, this is
|
||||
// only for Mac at the moment. There are equivalent versions
|
||||
// for Linux that we can add if needed.
|
||||
pthread_setname_np(buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
rust_sched_loop_state state = sched_loop_state_keep_going;
|
||||
while (state != sched_loop_state_exit) {
|
||||
DLOG(sched_loop, dom, "pumping scheduler");
|
||||
|
@ -130,6 +130,8 @@ public:
|
||||
// Called by tasks when they need a stack on which to run C code
|
||||
stk_seg *borrow_c_stack();
|
||||
void return_c_stack(stk_seg *stack);
|
||||
|
||||
int get_id() { return this->id; }
|
||||
};
|
||||
|
||||
inline rust_log &
|
||||
|
Loading…
Reference in New Issue
Block a user