I'm trying to get Ice working under FreeBSD.
It builds fine but make test fails:
After some investigation it turned out that in Mutex.h the return value of pthread_mutex_trylock() is tested against EBUSY. But the new threading library in FreeBSD returns EDEADLK (which seems to be okay according to the standard).Code:running mutex test... ../../../include/IceUtil/Mutex.h:323: IceUtil::ThreadSyscallException: thread syscall exception: Resource deadlock avoided failed test mutex failed
This simple patch solves the problem:
Exactly the same problem occurs in StaticMutex.h.Code:--- include/IceUtil/Mutex.h.orig Sun May 23 23:52:37 2004 +++ include/IceUtil/Mutex.h Sun May 23 23:54:30 2004 @@ -318,7 +318,7 @@ Mutex::tryLock() const { int rc = pthread_mutex_trylock(&_mutex); - if(rc != 0 && rc != EBUSY) + if(rc != 0 && rc != EBUSY && rc != EDEADLK) { throw ThreadSyscallException(__FILE__, __LINE__, rc); }
After patching both header files make test just works fine.

Reply With Quote
