示例#1
0
int Worker::Run() {
	while (!workQueue.IsShutdown()){
		Work* now = workQueue.GetWork();
		if (now == NULL) continue;
		int ret = now->DoWork();
		if (ret){
			//printf("Woerker error code : %d\n", ret);
		}
	}
	return 0;
}
示例#2
0
int Worker::Run() {
    // TODO: 工作循环
    while (1) {
	Work* work = workQueue.GetWork();
	if (work != NULL) {
	    work->DoWork();
	    if (work->NeedDelete()) {
		delete work;
	    }
	}
	else if (workQueue.IsShutdown())
	    break;
    }

    return 0;
}