Back to index

glibc  2.9
tst-mutexpp6.c
Go to the documentation of this file.
00001 #include <pthread.h>
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 
00005 #include "tst-tpp.h"
00006 
00007 static pthread_mutexattr_t a;
00008 
00009 static void
00010 prepare (void)
00011 {
00012   init_tpp_test ();
00013 
00014   if (pthread_mutexattr_init (&a) != 0)
00015     {
00016       puts ("mutexattr_init failed");
00017       exit (1);
00018     }
00019 
00020   if (pthread_mutexattr_setprotocol (&a, PTHREAD_PRIO_PROTECT) != 0)
00021     {
00022       puts ("mutexattr_setprotocol failed");
00023       exit (1);
00024     }
00025 
00026   if (pthread_mutexattr_setprioceiling (&a, 6) != 0)
00027     {
00028       puts ("mutexattr_setprioceiling failed");
00029       exit (1);
00030     }
00031 }
00032 #define PREPARE(argc, argv) prepare ()
00033 
00034 static int do_test (void);
00035 
00036 static int
00037 do_test_wrapper (void)
00038 {
00039   init_tpp_test ();
00040   return do_test ();
00041 }
00042 #define TEST_FUNCTION do_test_wrapper ()
00043 
00044 #define ATTR &a
00045 #include "tst-mutex6.c"