Access current task PID in IBM Rhapsody 9.0.1

139 Views Asked by At

I am using IBM Rhapsody 9.0.1 Following this link I am trying to obtain the current task's handle, or even the OS Pid, of the current process/thread. (we are migrating from an SDL tool called TAU to Rhapsody)

Unfortunately am not able to call/reference the function [getOsHandle()]2 of the OXF. My class is active hence, I can see the import of <oxf\omthread.h> in the generated code but i cannot call the function or even use the type RiCOSHandle

How can I add the OSAL classes to my package?

2

There are 2 best solutions below

2
On BEST ANSWER
(int)(reinterpret_cast<intptr_t>(this->getOsHandle())))
0
On

I have used

// Setting of the Priority of this thread.
Rhp_int32_t rv = 0; 
pid_t tid;
tid = syscall(SYS_gettid);
rv = setpriority(PRIO_PROCESS, tid, TPRIORITY_NORMAL-20); // linux function