Threads displayed.

This commit is contained in:
Ben Vanik
2013-12-25 17:31:53 -08:00
parent d368e0cb74
commit a1da55a006
19 changed files with 468 additions and 131 deletions

View File

@@ -22,7 +22,7 @@ __declspec(thread) ThreadState* thread_state_ = NULL;
ThreadState::ThreadState(Runtime* runtime, uint32_t thread_id) :
runtime_(runtime), memory_(runtime->memory()),
thread_id_(thread_id),
thread_id_(thread_id), name_(0),
backend_data_(0), raw_context_(0) {
if (thread_id_ == UINT_MAX) {
// System thread. Assign the system thread ID with a high bit
@@ -40,6 +40,19 @@ ThreadState::~ThreadState() {
if (thread_state_ == this) {
thread_state_ = NULL;
}
if (name_) {
xe_free(name_);
}
}
void ThreadState::set_name(const char* value) {
if (value == name_) {
return;
}
if (name_) {
xe_free(name_);
}
name_ = xestrdupa(value);
}
void ThreadState::Bind(ThreadState* thread_state) {