summaryrefslogtreecommitdiffstats
path: root/pcilib/lock.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2015-08-06 01:13:17 +0200
committerSuren A. Chilingaryan <csa@suren.me>2015-08-06 01:13:17 +0200
commit63bc897c9444b364b0364bfd04a0c87d9fe29307 (patch)
tree39545e40bd78198eeb49f41f47ecdbf7ea6979fb /pcilib/lock.c
parent56787b1553bd151eff62741e34fb3b4834073442 (diff)
downloadpcitool-63bc897c9444b364b0364bfd04a0c87d9fe29307.tar.gz
pcitool-63bc897c9444b364b0364bfd04a0c87d9fe29307.tar.bz2
pcitool-63bc897c9444b364b0364bfd04a0c87d9fe29307.tar.xz
pcitool-63bc897c9444b364b0364bfd04a0c87d9fe29307.zip
Provide pcilib_try_lock call
Diffstat (limited to 'pcilib/lock.c')
-rw-r--r--pcilib/lock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pcilib/lock.c b/pcilib/lock.c
index 13e363a..9045ffa 100644
--- a/pcilib/lock.c
+++ b/pcilib/lock.c
@@ -190,6 +190,10 @@ int pcilib_lock(pcilib_lock_t* lock) {
return pcilib_lock_custom(lock, PCILIB_LOCK_FLAGS_DEFAULT, PCILIB_TIMEOUT_INFINITE);
}
+int pcilib_try_lock(pcilib_lock_t* lock) {
+ return pcilib_lock_custom(lock, PCILIB_LOCK_FLAGS_DEFAULT, PCILIB_TIMEOUT_IMMEDIATE);
+}
+
/**
* this function will unlock the semaphore pointed by lock_ctx.
*/