Added pth_process_shared_mutex regression test.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9398
This commit is contained in:
Bart Van Assche 2009-03-13 17:32:07 +00:00
parent a724e79a82
commit 22b77e39d7
4 changed files with 40 additions and 0 deletions

View File

@ -110,6 +110,8 @@ EXTRA_DIST = \
pth_inconsistent_cond_wait.stderr.exp1 \
pth_inconsistent_cond_wait.stderr.exp2 \
pth_inconsistent_cond_wait.vgtest \
pth_process_shared_mutex.vgtest \
pth_process_shared_mutex.c \
pth_spinlock.stderr.exp \
pth_spinlock.vgtest \
qt4_mutex.stderr.exp \
@ -211,6 +213,7 @@ check_PROGRAMS = \
pth_create_chain \
pth_detached \
pth_detached_sem \
pth_process_shared_mutex \
pth_inconsistent_cond_wait \
recursive_mutex \
rwlock_race \

View File

@ -0,0 +1,30 @@
/*
* Test program that locks and unlocks a process-shared mutex.
* See also https://bugs.kde.org/show_bug.cgi?id=187048.
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <pthread.h>
int main()
{
pthread_mutex_t mutex;
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
pthread_mutex_init(&mutex, &attr);
pthread_mutexattr_destroy(&attr);
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&mutex);
fprintf(stderr, "Finished.\n");
return 0;
}

View File

@ -0,0 +1,4 @@
Finished.
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

View File

@ -0,0 +1,3 @@
prereq: ./supported_libpthread
prog: pth_process_shared_mutex
vgopts: --var-info=yes --check-stack-var=yes