Rev 1264 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1264 | Rev 1502 | ||
|---|---|---|---|
| Line 51... | Line 51... | ||
| 51 | * Acquire mutex. |
51 | * Acquire mutex. |
| 52 | * Timeout mode and non-blocking mode can be requested. |
52 | * Timeout mode and non-blocking mode can be requested. |
| 53 | * |
53 | * |
| 54 | * @param mtx Mutex. |
54 | * @param mtx Mutex. |
| 55 | * @param usec Timeout in microseconds. |
55 | * @param usec Timeout in microseconds. |
| 56 | * @param trylock Switches between blocking and non-blocking mode. |
56 | * @param flags Specify mode of operation. |
| 57 | * |
57 | * |
| 58 | * For exact description of possible combinations of |
58 | * For exact description of possible combinations of |
| 59 | * usec and trylock, see comment for waitq_sleep_timeout(). |
59 | * usec and flags, see comment for waitq_sleep_timeout(). |
| 60 | * |
60 | * |
| 61 | * @return See comment for waitq_sleep_timeout(). |
61 | * @return See comment for waitq_sleep_timeout(). |
| 62 | */ |
62 | */ |
| 63 | int _mutex_lock_timeout(mutex_t *mtx, __u32 usec, int trylock) |
63 | int _mutex_lock_timeout(mutex_t *mtx, __u32 usec, int flags) |
| 64 | { |
64 | { |
| 65 | return _semaphore_down_timeout(&mtx->sem, usec, trylock); |
65 | return _semaphore_down_timeout(&mtx->sem, usec, flags); |
| 66 | } |
66 | } |
| 67 | 67 | ||
| 68 | /** Release mutex |
68 | /** Release mutex |
| 69 | * |
69 | * |
| 70 | * Release mutex. |
70 | * Release mutex. |
| Line 73... | Line 73... | ||
| 73 | */ |
73 | */ |
| 74 | void mutex_unlock(mutex_t *mtx) |
74 | void mutex_unlock(mutex_t *mtx) |
| 75 | { |
75 | { |
| 76 | semaphore_up(&mtx->sem); |
76 | semaphore_up(&mtx->sem); |
| 77 | } |
77 | } |
| - | 78 | ||