Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread_pool::get_thread() #2

Open
Hz188 opened this issue Jul 14, 2023 · 1 comment
Open

thread_pool::get_thread() #2

Hz188 opened this issue Jul 14, 2023 · 1 comment

Comments

@Hz188
Copy link

Hz188 commented Jul 14, 2023

thread_queue<task_msg>* thread_pool::get_thread(){
    if(_index == _thread_cnt) {
        _index = 0;
    }

    return _queues[_index];
}

刘老师您好,这里我们获取线程池中的队列的时候**_index是否应该++**?
源代码中_index好像没有在任何地方进行更新,所以每次取的都是_queue[0]了

@MrWnag
Copy link
Collaborator

MrWnag commented Jul 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants