~ubuntu-branches/ubuntu/saucy/mutextrace/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/mutex_working.c

  • Committer: Bazaar Package Importer
  • Author(s): Simon Richter
  • Date: 2009-11-30 15:26:21 UTC
  • Revision ID: james.westby@ubuntu.com-20091130152621-kxucetq7b43lx9fu
Tags: upstream-0.1
ImportĀ upstreamĀ versionĀ 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_CONFIG_H
 
2
#include <config.h>
 
3
#endif
 
4
 
 
5
#include <pthread.h>
 
6
 
 
7
int main()
 
8
{
 
9
    pthread_mutex_t mutex;
 
10
 
 
11
    if(pthread_mutex_init(&mutex, 0))
 
12
        return 1;
 
13
 
 
14
    if(pthread_mutex_lock(&mutex))
 
15
        return 1;
 
16
 
 
17
    if(pthread_mutex_unlock(&mutex))
 
18
        return 1;
 
19
 
 
20
    if(pthread_mutex_destroy(&mutex))
 
21
        return 1;
 
22
 
 
23
    return 0;
 
24
}