diff -u /boot/home/Unzipped/libxml2/nanohttp.c /BeStorage/Sources/Apps/My/LibPak/src_current/libxml2-2.6.1/nanohttp.c --- /boot/home/Unzipped/libxml2/nanohttp.c Wed Oct 29 14:39:15 2003 +++ /BeStorage/Sources/Apps/My/LibPak/src_current/libxml2-2.6.1/nanohttp.c Fri Oct 31 19:45:01 2003 @@ -909,6 +909,12 @@ status = ioctl(s, FIONBIO, &enable); } #else /* VMS */ +#if defined(__BEOS__) + { + bool noblock = true; + status = setsockopt(s, SOL_SOCKET, SO_NONBLOCK, &noblock, sizeof(noblock)); + } +#else /* __BEOS__ */ if ((status = fcntl(s, F_GETFL, 0)) != -1) { #ifdef O_NONBLOCK status |= O_NONBLOCK; @@ -927,6 +933,7 @@ closesocket(s); return(-1); } +#endif /* !__BEOS__ */ #endif /* !VMS */ #endif /* !_WINSOCKAPI_ */ diff -u /boot/home/Unzipped/libxml2/threads.c /BeStorage/Sources/Apps/My/LibPak/src_current/libxml2-2.6.1/threads.c --- /boot/home/Unzipped/libxml2/threads.c Wed Oct 29 14:39:15 2003 +++ /BeStorage/Sources/Apps/My/LibPak/src_current/libxml2-2.6.1/threads.c Sat Nov 1 00:27:20 2003 @@ -62,6 +62,7 @@ HANDLE mutex; #elif defined HAVE_BEOS_THREADS sem_id sem; + thread_id tid; #else int empty; #endif @@ -143,6 +144,7 @@ free(tok); return NULL; } + tok->tid = -1; #endif return (tok); } @@ -191,6 +193,7 @@ exit(); #endif } + tok->tid = find_thread(NULL); #endif } @@ -211,7 +214,10 @@ #elif defined HAVE_WIN32_THREADS ReleaseMutex(tok->mutex); #elif defined HAVE_BEOS_THREADS - release_sem(tok->sem); + if (tok->tid == find_thread(NULL)) { + tok->tid = -1; + release_sem(tok->sem); + } #endif } @@ -246,7 +252,6 @@ return NULL; } tok->count = 0; - tok->tid = 0; #endif return (tok); } @@ -303,12 +308,11 @@ EnterCriticalSection(&tok->cs); ++tok->count; #elif defined HAVE_BEOS_THREADS - if (tok->tid == find_thread(NULL)) { + if (tok->lock->tid == find_thread(NULL)) { tok->count++; return; } else { xmlMutexLock(tok->lock); - tok->tid = find_thread(NULL); tok->count = 1; } #endif @@ -338,10 +342,9 @@ if (!--tok->count) LeaveCriticalSection(&tok->cs); #elif defined HAVE_BEOS_THREADS - if (tok->tid == find_thread(NULL)) { + if (tok->lock->tid == find_thread(NULL)) { tok->count--; if (tok->count == 0) { - tok->tid = 0; xmlMutexUnlock(tok->lock); } return;