diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-03-03 10:34:49 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-03-03 10:34:49 +0100 |
commit | ee16e47966afe180d3c32e2b1d93301052894fac (patch) | |
tree | 56aecf261aaae57e28c08cef573ae6642ec5394d /xml/test/test_prop4.py | |
parent | 02d0026e2df2ba5c68c0c1a67aec4437c9e8e8f3 (diff) | |
parent | 195c28f3074486165b6e0935362810f8a1fb9531 (diff) | |
download | pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.gz pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.bz2 pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.xz pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.zip |
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 369 revision
Diffstat (limited to 'xml/test/test_prop4.py')
-rw-r--r-- | xml/test/test_prop4.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/xml/test/test_prop4.py b/xml/test/test_prop4.py new file mode 100644 index 0000000..30e9ece --- /dev/null +++ b/xml/test/test_prop4.py @@ -0,0 +1,23 @@ +import time +import threading +lock = threading.Lock() + +def read_from_register(ctx, value): + with lock: + ctx.lock('test_prop4') + + cur = read_from_register.counter + read_from_register.counter += 1 + for i in range (0, 5): + time.sleep(0.1) + out = ctx.get_property('/test/prop3') / 2 + + ctx.unlock('test_prop4') + + return out + +read_from_register.counter = 0 + +def write_to_register(ctx, value): + with lock: + ctx.set_property(value*2, '/test/prop3') |