1. We are not using Visual C++ or EVC. We have our own port of the GNU
toolchain (binutils-2.13.90 & gcc-3.2).
2. Except for a very few primitives from coredll.dll, we are not using
the Micro$oft runtime - we are using "newlib" instead.
The porting work that was required seemed fairly straightforward and
affected mostly only header files in the end. Unfortunately, the result
is not entirely working yet. In particular, mutex/condvar destruction
is always returning "16" instead of "0" (EBUSY??). Here is an example
program that shows the problem, along with the output:
#include <pthread.h>
#include <errno.h>
main(int argc, char *argv[])
{
int i, stat;
pthread_mutex_t mutex;
pthread_cond_t cond;
pthread_win32_process_attach_np();
pthread_win32_thread_attach_np();
stat = pthread_mutex_init(&mutex, NULL);
printf("pthread_mutex_init returns %d, errno %d\n", stat, errno);
stat = pthread_cond_init(&cond, NULL);
printf("pthread_cond_init returns %d, errno %d\n", stat, errno);
stat = pthread_cond_destroy(&cond);
printf("pthread_cond_destroy returns %d, errno %d\n", stat, errno);
stat = pthread_mutex_destroy(&mutex);
printf("pthread_mutex_destroy returns %d, errno %d\n", stat, errno);
getchar();
}
The output is thus:
thread_mutex_init returns 0, errno 0
pthread_cond_init returns 0, errno 0
pthread_cond_destroy returns 16, errno 0
pthread_mutex_destroy returns 16, errno 0
Apparently "EBUSY" is returned when there are waiters on synchronization
objects. Clearly that can't be the case here so there must be something
wrong with my port. The question is - what?? Any ideas on where to
look or what to do would be vastly appreciated.
TIA,
craig vanderborgh
voxware incorporated