Skip to content

Commit

Permalink
Merge pull request #592 from lukemartinlogan/hermes-1.1
Browse files Browse the repository at this point in the history
Add gettid wrapper
  • Loading branch information
lukemartinlogan authored Sep 15, 2023
2 parents bff7651 + 208362a commit bf422bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion include/labstor/work_orchestrator/worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
#include "affinity.h"
#include "labstor/network/rpc_thallium.h"

static inline pid_t GetLinuxTid() {
return syscall(SYS_gettid);
}

namespace labstor {

#define WORKER_CONTINUOUS_POLLING BIT_OPT(u32, 0)
Expand Down Expand Up @@ -167,7 +171,7 @@ class Worker {
EnableContinuousPolling();
retries_ = 1;
pid_ = 0;
pthread_id_ = gettid();
pthread_id_ = GetLinuxTid();
// TODO(llogan): implement reserve for group
group_.resize(512);
group_.resize(0);
Expand Down
2 changes: 1 addition & 1 deletion src/worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace labstor {

void Worker::Loop() {
pid_ = gettid();
pid_ = GetLinuxTid();
WorkOrchestrator *orchestrator = LABSTOR_WORK_ORCHESTRATOR;
while (orchestrator->IsAlive()) {
try {
Expand Down
2 changes: 1 addition & 1 deletion tasks_required/proc_queue/src/proc_queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Server : public TaskLib {
case PushTaskPhase::kSchedule: {
task->ptr_ = LABSTOR_CLIENT->GetPrivatePointer<Task>(task->subtask_);
HILOG(kDebug, "Scheduling task {} on state {} tid {}",
task->ptr_->task_node_, task->ptr_->task_state_, gettid());
task->ptr_->task_node_, task->ptr_->task_state_, GetLinuxTid());
if (task->ptr_->IsFireAndForget()) {
task->ptr_->UnsetFireAndForget();
}
Expand Down

0 comments on commit bf422bc

Please sign in to comment.