Created
May 30, 2014 01:18
-
-
Save khenriks/82b3e5f788d61ce66fe0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <omp.h> | |
#include <pthread.h> | |
int main() { | |
omp_lock_t lock; | |
long x = 0; | |
omp_init_lock(&lock); | |
for (int i=0; i<1; ++i) { | |
omp_set_lock(&lock); | |
omp_unset_lock(&lock); | |
} | |
omp_destroy_lock(&lock); | |
printf("sizeof(omp_lock_t): %zu\n", sizeof(omp_lock_t)); | |
printf("sizeof(pthread_mutex_t): %zu\n", sizeof(pthread_mutex_t)); | |
printf("Value of x (should be 0): %ld\n", x); | |
return x != 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment