Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rwlock1.c « pthread « winsup.api « testsuite « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 25e29f6acdc2a31a69f42c5b0a85438ba87aab33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* 
 * rwlock1.c
 *
 * Create a simple rwlock object and then destroy it.
 *
 * Depends on API functions:
 * 	pthread_rwlock_init()
 *	pthread_rwlock_destroy()
 */

#include "test.h"

pthread_rwlock_t rwlock = NULL;

int
main()
{
  assert(rwlock == NULL);

  assert(pthread_rwlock_init(&rwlock, NULL) == 0);

  assert(rwlock != NULL);

  assert(pthread_rwlock_destroy(&rwlock) == 0);

  assert(rwlock == NULL);

  return 0;
}