diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-08-08 16:27:17 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-08-09 13:54:57 -0500 |
commit | be61bd382972ec946396dadc161231c65ea9d968 (patch) | |
tree | 29acf3176ca910cd3f740d930b9d1fcee0c0e382 /src/usr | |
parent | af0bcd44f7c475eb00178d4f448a14343c0354c0 (diff) | |
download | talos-hostboot-be61bd382972ec946396dadc161231c65ea9d968.tar.gz talos-hostboot-be61bd382972ec946396dadc161231c65ea9d968.zip |
Clean up mutex issues.
- Final fix for mutex bug.
- Document weak-consistency decisions in mutex code.
- Prevent aggressive optimizations around lwsync/isync instrs.
- Fix minor bug in futex_wait system call.
- Optimize futex path with likely/unlikely hints.
Change-Id: I26b54dee7e45bcb42195f730474b350b44f53cfc
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/233
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/testcore/lib/synctest.H | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/usr/testcore/lib/synctest.H b/src/usr/testcore/lib/synctest.H index 5a53d2e0a..8e7619d11 100644 --- a/src/usr/testcore/lib/synctest.H +++ b/src/usr/testcore/lib/synctest.H @@ -9,6 +9,7 @@ #include <cxxtest/TestSuite.H> #include <sys/sync.h> #include <sys/task.h> +#include <sys/time.h> class SyncTest: public CxxTest::TestSuite { @@ -30,6 +31,20 @@ class SyncTest: public CxxTest::TestSuite TS_TRACE("ALL THREADS ENDED"); } + void testMutexDoubleWait() + { + mutex_init(&mutex); + barrier_init(&barrier, 3); + + mutex_lock(&mutex); + task_create(func2, this); + task_create(func2, this); + nanosleep(1,0); + mutex_unlock(&mutex); + barrier_wait(&barrier); + TS_TRACE("ALL THREADS ENDED"); + } + void testBarrier() { barrier_t barrier; |