public inbox for
 help / color / mirror / Atom feed
From: jamescmaki <>
Subject: Re: Cyg_Mutex::check_this() fails
Date: Fri, 15 Mar 2013 17:56:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <000901ce09de$3d3dc0d0$b7b94270$@cc>

Hi Rene,

At this point in the code the scheduler is not locked and the mutex is not
owned. This means that it is a bad idea to be looking at the internal state
of the mutex, i.e., calling CYG_ASSERTCLASS( mx, "Corrupt mutex").

I can reproduce this issue consistently now and I am testing a fix that
changes CYG_ASSERTCLASS to CYG_ASSERT. I am hoping that this will resolve
the problem instead of just moving the failed assert into Cyg_Mutex::lock().

However even if this does fix the problem, I am still wary. From what I can
see, locked and owner are never modified without locking the scheduler. This
means that they are both updated atomically. Because of this, when the
thread in  wait_inner() resumes it should see both of these variables in a
consistent state regardless of whether it holds a lock or not. I am
wondering if this can be explained by reordering and by delaying the check
until the scheduler is locked again it avoids this problem.


View this message in context:
Sent from the Sourceware - ecos-devel mailing list archive at

  reply	other threads:[~2013-03-15 17:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13 11:36 René Schipp von Branitz Nielsen
2013-03-15 17:56 ` jamescmaki [this message]
2013-03-15 19:12   ` jamescmaki

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 \ \ \ \

* 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).