I am writing a program in C++
which works with threads. When I try to create a process I get the following error: Member function must be called or its address taken in function
. Here is my code:
void PCB::createProcess(){
asm cli
this->stack = new unsigned[stackSize];
stack[stackSize-1] = 0x200;
stack[stackSize-2] = FP_SEG(wrapper);
stack[stackSize-3] = FP_OFF(wrapper);
this->ss = FP_SEG(stack+stackSize-12);
this->sp = FP_OFF(stack+stackSize-12);
asm sti
}
void PCB::wrapper(){
myThread->run();
myThread->state = TERMINATED;
}
I get the error in these two lines:
stack[stackSize-2] = FP_SEG(wrapper);
stack[stackSize-3] = FP_OFF(wrapper);
I have tried everything.
I have tried (&(wrapper))
, PCB::wrapper
, &PCB::wrapper
and nothing helps, it just gives me more errors. PCB
is the name of the class.
If anyone has an idea, please help.