Last change
on this file since 8450 was 7583, checked in by gf, 11 years ago |
Move locking functions from oscam-simples.c to oscam-lock.c
|
File size:
713 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, int16_t timeout, const char *name);
|
---|
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.