source: CIVL/examples/experimental/pthreadTransformerTest.cvl@ bb03188

main test-branch
Last change on this file since bb03188 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 309 bytes
RevLine 
[faa91bf]1#include <pthread.h>
2
3#define ARRAYSIZE 1000
4
5pthread_mutex_t count_mutex;
6
7int a[ARRAYSIZE];
8int count = 0;
9
10int main(){
11 int ret_count = pthread_mutex_init(&count_mutex, NULL);
12 pthread_mutex_lock (&count_mutex);
13 count = count + 1;
14 pthread_mutex_unlock (&count_mutex);
15 a[0] = count;
16 return a[0];
17}
Note: See TracBrowser for help on using the repository browser.