Home | History | Annotate | Download | only in memory_replay

Lines Matching defs:thread

30 #include "Thread.h"
34 Thread* thread = reinterpret_cast<Thread*>(data);
36 thread->WaitForPending();
37 Action* action = thread->GetAction();
38 thread->AddTimeNsecs(action->Execute(thread->pointers()));
40 thread->ClearPending();
51 data_size_ = (max_threads_ * sizeof(Thread) + pagesize - 1) & ~(pagesize - 1);
52 max_threads_ = data_size_ / sizeof(Thread);
60 if (Thread::ACTION_SIZE < Action::MaxActionSize()) {
61 err(1, "Thread action size is too small: ACTION_SIZE %zu, max size %zu\n",
62 Thread::ACTION_SIZE, Action::MaxActionSize());
65 threads_ = new (memory) Thread[max_threads_];
76 Thread* Threads::CreateThread(pid_t tid) {
80 Thread* thread = FindEmptyEntry(tid);
81 if (thread == nullptr) {
85 thread->tid_ = tid;
86 thread->pointers_ = pointers_;
87 thread->total_time_nsecs_ = 0;
88 if (pthread_create(&thread->thread_id_, nullptr, ThreadRunner, thread) == -1) {
89 err(1, "Failed to create thread %d: %s\n", tid, strerror(errno));
93 return thread;
96 Thread* Threads::FindThread(pid_t tid) {
127 Thread* Threads::FindEmptyEntry(pid_t tid) {
140 void Threads::Finish(Thread* thread) {
141 int ret = pthread_join(thread->thread_id_, nullptr);
146 total_time_nsecs_ += thread->total_time_nsecs_;
147 thread->tid_ = 0;