之前为了找出Sphinx中index ‘test1’: search error: query too complex, not enough stack (thread_stack=1217498K or higher required)这个bug,大致看了一下Sphinx的源码,发现问题的原因是在计算线程使用的空间时出错,具体原因依然没有找到,还在努力当中。在这个过程中,看到以下这段程序
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
voidsphSleepMsec( int iMsec ) { if ( iMsec<0 ) return;
#if USE_WINDOWS Sleep ( iMsec );
#else struct timeval tvTimeout; tvTimeout.tv_sec = iMsec / 1000; // full seconds tvTimeout.tv_usec = ( iMsec % 1000 ) * 1000; // remainder is msec, so *1000 for usec