Commit Graph

16 Commits

Author SHA1 Message Date
Julian Seward
d8b60ad050 Minor tweaks to the nonblocking select() implementation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@108
2002-04-21 01:08:26 +00:00
Julian Seward
51ab497158 Add pthread_mutex_trylock, and add various other hacks to try and make
Mozilla work.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@107
2002-04-21 00:13:57 +00:00
Julian Seward
03b823c2a6 Add pthread_condattr_destroy.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@104
2002-04-20 13:59:33 +00:00
Julian Seward
e39f3f644a Add fairly complete, and apparently working, support for condition
variables.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@102
2002-04-20 13:53:23 +00:00
Julian Seward
1f17043004 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
2002-04-19 14:40:57 +00:00
Julian Seward
3d7ec5ac90 Simply and rationalise pthread_mutex implementation, in preparation
for implementation of condition variables.

* Use the native pthread_mutex_t directly; we no longer have our own
  VgMutex type nor a fixed array of them.

* Give ThreadState a new field q_next :: ThreadId, used to make a
  linked list of threads waiting on a mutex, or condition variable.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@99
2002-04-18 22:38:41 +00:00
Julian Seward
f6f515f0b8 Yay! Opera (6.0TP2) now works.
Various enhancements:

* Make the error message system more thread-aware.

* Fix stupid bug in do_pthread_create causing incorrect initial
  %ESP values sometimes.

* Fix various other minor things needed to make opera work.

Performance of threaded apps is pretty terrible.  This needs
looking into.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@98
2002-04-18 11:37:52 +00:00
Julian Seward
1c469385c2 Sanity check mutex implementation, and add support for recursive mutexes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@94
2002-04-17 23:21:37 +00:00
Julian Seward
fe8ade38b8 Change --trace-pthread= flag to accept none|some|all, for finer level
of pthread event tracing.  And allow this info to be passed across to
the client, where vg_libpthread.c uses it to also control verbosity.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@91
2002-04-16 22:50:32 +00:00
Julian Seward
8f0229881b Add more pthread wrappers in a failed attempt to get Opera 6.0TP2
to run.  Now it creates some threads but segfaults.  Also add
wrapper for syscall __NR_mremap; it is way wrong, but finding
a decent description of what mremap() really does is nearly
impossible.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@89
2002-04-16 04:40:49 +00:00
Julian Seward
738517097f Turn off debug printing by default.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@67
2002-04-14 13:27:00 +00:00
Julian Seward
5d8300dd17 Add dummy stubs for pthread_key_create, pthread_key_delete,
pthread_setspecific, pthread_getspecific.  They don't do anything
right now and may well crash programs which use them.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@66
2002-04-14 13:13:05 +00:00
Julian Seward
acf89323f4 Add wrapper for lseek().
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@61
2002-04-13 04:18:32 +00:00
Julian Seward
80dc6e4215 Ultra-hacking implementation of non-blocking select() using blocking
select and non-blocking nanosleep().  Barf.  Does seem to work tho.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@59
2002-04-13 03:45:44 +00:00
Julian Seward
c59b539faf Clean up debug printing for scheduler / pthreads. Two new flags,
--trace-sched=no|yes and --trace-pthread=no|yes, if you really want
to see tons of gory details.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@55
2002-04-12 20:12:20 +00:00
Julian Seward
1271ae8557 New files to support pthreads.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@51
2002-04-12 10:26:32 +00:00