Home | History | Annotate | Download | only in pthread_mutex_init
      1 /*
      2  * Copyright (c) 2002, Intel Corporation. All rights reserved.
      3  * Created by:  bing.wei.liu REMOVE-THIS AT intel DOT com
      4  * This file is licensed under the GPL license.  For the full content
      5  * of this license, see the COPYING file at the top level of this
      6  * source tree.
      7 
      8  * Test that the macro PTHREAD_MUTEX_INITIALIZER can be sued to intiailize
      9  * mutexes that are statically allocated.
     10  *
     11  */
     12 
     13 #include <pthread.h>
     14 #include <stdio.h>
     15 #include <errno.h>
     16 #include "posixtest.h"
     17 
     18 typedef struct my_data {
     19 	pthread_mutex_t mutex;	/* Protects access to value */
     20 	int value;		/* Access protected by mutex */
     21 } my_data_t;
     22 
     23 my_data_t data = { PTHREAD_MUTEX_INITIALIZER, 0 };
     24 
     25 int main(void)
     26 {
     27 	printf("Test PASSED\n");
     28 	return PTS_PASS;
     29 }
     30