Last change
on this file since 9568 was 9309, checked in by gf, 10 years ago |
clockfix: Prepare cs_lock's to start using millisecond timeouts.
This does not switch lock's to milliseconds yet, it is just a preparation.
The parameter order is changed to catch missing conversions by watching
for compiler warnings.
|
File size:
724 bytes
|
Line | |
---|
1 | #ifndef OSCAM_LOCK_H_
|
---|
2 | #define OSCAM_LOCK_H_
|
---|
3 |
|
---|
4 | // Lock types
|
---|
5 | #define WRITELOCK 1
|
---|
6 | #define READLOCK 2
|
---|
7 |
|
---|
8 | void cs_lock_create(CS_MUTEX_LOCK *l, const char *name, uint32_t timeout_ms);
|
---|
9 | void cs_lock_destroy(CS_MUTEX_LOCK *l);
|
---|
10 | void cs_rwlock_int(CS_MUTEX_LOCK *l, int8_t type);
|
---|
11 | void cs_rwunlock_int(CS_MUTEX_LOCK *l, int8_t type);
|
---|
12 | int8_t cs_try_rwlock_int(CS_MUTEX_LOCK *l, int8_t type);
|
---|
13 |
|
---|
14 | #define cs_writelock(l) cs_rwlock_int(l, WRITELOCK)
|
---|
15 | #define cs_readlock(l) cs_rwlock_int(l, READLOCK)
|
---|
16 | #define cs_writeunlock(l) cs_rwunlock_int(l, WRITELOCK)
|
---|
17 | #define cs_readunlock(l) cs_rwunlock_int(l, READLOCK)
|
---|
18 | #define cs_try_writelock(l) cs_try_rwlock_int(l, WRITELOCK)
|
---|
19 | #define cs_try_readlock(l) cs_try_rwlock_int(l, READLOCK)
|
---|
20 |
|
---|
21 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.