We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
MYSQL *connection_pool::GetConnection() { MYSQL *con = NULL; if (0 == connList.size()) return NULL; reserve.wait(); lock.lock(); con = connList.front(); connList.pop_front(); --m_FreeConn; ++m_CurConn; lock.unlock(); return con; }
大佬们,我想问一下,这个函数中为什么要做if(0==connList.size())这个判断?如果做了这个判断不久直接返回了吗,就不会有后面的reserve.wait()等待了呀?
if(0==connList.size())
reserve.wait()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
大佬们,我想问一下,这个函数中为什么要做
if(0==connList.size())
这个判断?如果做了这个判断不久直接返回了吗,就不会有后面的reserve.wait()
等待了呀?The text was updated successfully, but these errors were encountered: