Weird Events

来源:互联网 发布:淘宝发空包是什么意思 编辑:程序博客网 时间:2024/06/05 17:55

Q1: (surrendered) istream::gcount() can not work?
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.