mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
Added pth_process_shared_mutex regression test.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9398
This commit is contained in:
parent
a724e79a82
commit
22b77e39d7
@ -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 \
|
||||
|
||||
30
drd/tests/pth_process_shared_mutex.c
Normal file
30
drd/tests/pth_process_shared_mutex.c
Normal 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;
|
||||
}
|
||||
4
drd/tests/pth_process_shared_mutex.stderr.exp
Normal file
4
drd/tests/pth_process_shared_mutex.stderr.exp
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
Finished.
|
||||
|
||||
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
|
||||
3
drd/tests/pth_process_shared_mutex.vgtest
Normal file
3
drd/tests/pth_process_shared_mutex.vgtest
Normal file
@ -0,0 +1,3 @@
|
||||
prereq: ./supported_libpthread
|
||||
prog: pth_process_shared_mutex
|
||||
vgopts: --var-info=yes --check-stack-var=yes
|
||||
Loading…
x
Reference in New Issue
Block a user