我正在编写一个C++
与线程一起工作的程序。当我尝试创建一个进程时,我收到以下错误:Member function must be called or its address taken in function
. 这是我的代码:
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;
}
我在这两行中得到错误:
stack[stackSize-2] = FP_SEG(wrapper);
stack[stackSize-3] = FP_OFF(wrapper);
我已经尝试了一切。我已经尝试过(&(wrapper))
,PCB::wrapper
但&PCB::wrapper
没有任何帮助,它只会给我更多的错误。PCB
是类的名称。
如果有人有想法,请帮助。