On Dec 14, 2008, at 3:31 PM, James Harkins wrote:
OK, it's intentional (below) but the c++ code doesn't answer the question, why? I've got some other gripes about CollStream that I'll save for later. :) hjh void vposttext(const char *str, int length); void vposttext(const char *str, int length) { pthread_mutex_lock(&mainPostBuf.mutex); if (postfile) { fwrite(str, length, 1, postfile); fflush(postfile); } for (int i=0; i<length && str[i]; ++i) { if (((mainPostBuf.wrpos+1) & POSTBUFMASK) == mainPostBuf.rdpos) { break; //mainPostBuf.Flush(); CANNOT DO THIS FROM OTHER THAN COCOA'S THREAD! } // here -wtf? if (str[i] == '\n') mainPostBuf.buf[mainPostBuf.wrpos] = '\r'; else mainPostBuf.buf[mainPostBuf.wrpos] = str[i]; mainPostBuf.wrpos = (mainPostBuf.wrpos+1) & POSTBUFMASK; } pthread_mutex_unlock(&mainPostBuf.mutex); } : H. James Harkins .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |