]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Continue trying to extract myself from the pthread_mutex_* swamp.
authorJulian Seward <jseward@acm.org>
Fri, 19 Apr 2002 14:40:57 +0000 (14:40 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 19 Apr 2002 14:40:57 +0000 (14:40 +0000)
commit1f17043004c82d0030c724315d8193087b978c6a
treee68e1500cf96b45df687e9648b2f929045b2e070
parent3d7ec5ac9029366775b54f36825354a06fa911d4
Continue trying to extract myself from the pthread_mutex_* swamp.

Fall back to a compromise position, which makes my mutex implementation
initialiser- and structure-compatible with LinuxThreads, and ditto the
upcoming condition var implementation.  In particular this means that
((ThreadId)0) is an invalid thread ID, so vg_threads[0] is never used,
and vg_threads[1] specially denotes the "main" thread.

Remove the scheme of having a linked list of threads waiting on
each mutex.  It is too difficult to get the right semantics for
when a signal is delivered to a thread blocked in pthread_mutex_lock().
Instead, use the old scheme of each thread stating with its .waited_on_mx
field, which mutex it is waiting for.  This makes pthread_mutex_unlock()
less efficient, but at least it all works.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@100
coregrind/arch/x86-linux/vg_libpthread.c
coregrind/vg_errcontext.c
coregrind/vg_include.h
coregrind/vg_libpthread.c
coregrind/vg_main.c
coregrind/vg_scheduler.c
vg_errcontext.c
vg_include.h
vg_libpthread.c
vg_main.c
vg_scheduler.c