diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
| commit | 45b533945f0851ec234ca846e1af5ee1e4df0b6e (patch) | |
| tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /test/Modules/Inputs/thread-safety | |
| parent | 7e86edd64bfae4e324224452e4ea879b3371a4bd (diff) | |
Notes
Diffstat (limited to 'test/Modules/Inputs/thread-safety')
| -rw-r--r-- | test/Modules/Inputs/thread-safety/a.h | 4 | ||||
| -rw-r--r-- | test/Modules/Inputs/thread-safety/b.h | 8 | ||||
| -rw-r--r-- | test/Modules/Inputs/thread-safety/c.h | 10 | ||||
| -rw-r--r-- | test/Modules/Inputs/thread-safety/module.map | 3 |
4 files changed, 25 insertions, 0 deletions
diff --git a/test/Modules/Inputs/thread-safety/a.h b/test/Modules/Inputs/thread-safety/a.h new file mode 100644 index 000000000000..879c038cf970 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/a.h @@ -0,0 +1,4 @@ +struct __attribute__((lockable)) mutex { + void lock() __attribute__((exclusive_lock_function)); + void unlock() __attribute__((unlock_function)); +}; diff --git a/test/Modules/Inputs/thread-safety/b.h b/test/Modules/Inputs/thread-safety/b.h new file mode 100644 index 000000000000..c8ed23738f18 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/b.h @@ -0,0 +1,8 @@ +#include "a.h" + +struct X { + mutex m; + int n __attribute__((guarded_by(m))); + + void f(); +}; diff --git a/test/Modules/Inputs/thread-safety/c.h b/test/Modules/Inputs/thread-safety/c.h new file mode 100644 index 000000000000..ec849c2250a3 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/c.h @@ -0,0 +1,10 @@ +#include "a.h" + +struct X { + mutex m; + int n __attribute__((guarded_by(m))); + + void f(); +}; + +inline void unlock(X &x) __attribute__((unlock_function(x.m))) { x.m.unlock(); } diff --git a/test/Modules/Inputs/thread-safety/module.map b/test/Modules/Inputs/thread-safety/module.map new file mode 100644 index 000000000000..bd6ea830c2d4 --- /dev/null +++ b/test/Modules/Inputs/thread-safety/module.map @@ -0,0 +1,3 @@ +module a { header "a.h" } +module b { header "b.h" export * } +module c { header "c.h" export * } |
