qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Mutex error checking (was: [PULL 00/26] Migration pull requ


From: Markus Armbruster
Subject: [Qemu-devel] Mutex error checking (was: [PULL 00/26] Migration pull request)
Date: Thu, 02 Jul 2015 14:55:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Peter Maydell <address@hidden> writes:

> On 2 July 2015 at 13:17, Juan Quintela <address@hidden> wrote:
>> Why, o why, o why it didn't fail on linux, why.  I think I know where
>> the problem is.
>
> I think OSX defaults to being pickier about its mutexes,
> whereas Linux defaults to "make lock/unlock as fast as
> possible and assume the program is correct".

>From pthread_mutexattr_settype(3p):

       PTHREAD_MUTEX_ERRORCHECK

              This type of mutex provides error checking. A thread
              attempting to relock this mutex without first unlocking it
              shall return with an error. A thread attempting to unlock
              a mutex which another thread has locked shall return with
              an error. A thread attempting to unlock an unlocked mutex
              shall return with an error.

Not sure it detects this particular problem.

Should we use it with --enable-debug or something?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]