From 63bc897c9444b364b0364bfd04a0c87d9fe29307 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 6 Aug 2015 01:13:17 +0200 Subject: Provide pcilib_try_lock call --- pcilib/lock.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pcilib/lock.c') 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. */ -- cgit v1.2.3