Skip to content

Commit 057582d

Browse files
committed
ril:add API to try lock
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent cacdc64 commit 057582d

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

include/ril/ril.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,23 @@ int ril_urc_detach(const char *keyword);
235235

236236
/**
237237
* Get exclusive access to Radio interface layer. This lock is only an advisory lock for RIL.
238-
* @note ril_lock() and ril_unlock() should be called from same task
239-
* @param timeout [in] Timeout value in milliseconds to wait for lock
240-
* @return 0 on success, -EWOULDBLOCK on error or when lock is unavailable
238+
* @note ril_lock(), ril_trylock() and ril_unlock() should be called from same task
239+
* @param wait [in] true to wait for lock, false to return immediately
240+
* @return 0 on success, -EWOULDBLOCK on error or when lock is unavailable
241241
*/
242-
int ril_lock(int timeout);
242+
int ril_lock(int wait);
243+
244+
/**
245+
* Get exclusive access to Radio interface layer. This lock is only an advisory lock for RIL.
246+
* @note ril_lock(), ril_trylock() and ril_unlock() should be called from same task
247+
* @param wait_ms [in] Wait time in milliseconds
248+
* @return 0 on success, -EWOULDBLOCK on error or when lock is unavailable
249+
*/
250+
int ril_trylock(int wait_ms);
243251

244252
/**
245253
* Unlock RIL layer
246-
* @note ril_lock() and ril_unlock() should be called from same task
254+
* @note ril_lock(), ril_trylock() and ril_unlock() should be called from same task
247255
*/
248256
void ril_unlock(void);
249257

0 commit comments

Comments
 (0)