public inbox for
 help / color / mirror / Atom feed
From: "Craig A. Vanderborgh" <>
Subject: Trouble with mutex/cond destroy on WINCE 3.0
Date: Tue, 25 Feb 2003 17:26:00 -0000	[thread overview]
Message-ID: <1046194147.4455.22.camel@zetar> (raw)

Hello All:

I have just done a port of pthreads-win32 to our recently completed
arm-wince-pe GNU development environment.  This is different that what
others have been doing with pthreads-win32 in the following ways:

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;

  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);


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.

craig vanderborgh
voxware incorporated

             reply	other threads:[~2003-02-25 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-25 17:26 Craig A. Vanderborgh [this message]
2003-02-25 23:15 ` Ross Johnson
2003-02-26 14:32 Bossom, John
2003-02-26 16:06 ` Craig A. Vanderborgh
2003-02-27  2:19 ` Ross Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1046194147.4455.22.camel@zetar \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).