I am a Chinese C++ programmer, my job is to develop network servers on POSIX and Win32 platforms.
I desire to communicate with other country's programmers.
My Chinese blog is http://blog.csdn.net/qwidget
A1: Now I apply strlen() function to the read-buffer instead of invocation to gcount() as a temporary alternative.
I should overview and debug the STL and Poco source code to find out what caused this event happened,
but time is not too much for me now, I promise here that I'll be back later when I have time. o(^_^)o
Q2: (cleared) Due to low-level implementation, Poco::FastMutex is recursive on win32 platform, and non-recursive on posix platform.
A2: CRITICAL_SECTION is default to be recursive, therefore FastMutex who just wrapping the EnterCriticalSection() call and do nothing else is not that adequate when whose code comment told me that FastMutex run as a non-recursive lock.
Q3: (cleared) Deadlock incurred in the scope with a scope-lock wrapper whose destructor when leave the scope will release the private mutex that acquired in the constructor at initial point of the scope.
A3: I admit my fault. -_-! I make potential lock-acquire call in the scope even who really does have a scope-lock wrapper."