Rev 1 | Rev 411 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 410 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | 28 | ||
29 | #ifndef __SYNCH_H__ |
29 | #ifndef __SYNCH_H__ |
30 | #define __SYNCH_H__ |
30 | #define __SYNCH_H__ |
31 | 31 | ||
32 | #define SYNCH_NO_TIMEOUT 0 |
32 | #define SYNCH_NO_TIMEOUT 0 /**< No timeout is request. */ |
33 | #define SYNCH_BLOCKING 0 |
33 | #define SYNCH_BLOCKING 0 /**< Blocking operation request. */ |
34 | #define SYNCH_NON_BLOCKING 1 |
34 | #define SYNCH_NON_BLOCKING 1 /**< Non-blocking operation request. */ |
35 | 35 | ||
36 | #define ESYNCH_WOULD_BLOCK 1 |
36 | #define ESYNCH_WOULD_BLOCK 1 /**< Could not satisfy the request without going to sleep. */ |
37 | #define ESYNCH_TIMEOUT 2 |
37 | #define ESYNCH_TIMEOUT 2 /**< Timeout occurred. */ |
38 | #define ESYNCH_OK_ATOMIC 4 |
38 | #define ESYNCH_OK_ATOMIC 4 /**< Operation succeeded without sleeping. */ |
39 | #define ESYNCH_OK_BLOCKED 8 |
39 | #define ESYNCH_OK_BLOCKED 8 /**< Operation succeeded and did sleep. */ |
40 | 40 | ||
41 | #define SYNCH_FAILED(rc) ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT)) |
41 | #define SYNCH_FAILED(rc) ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT)) |
42 | #define SYNCH_OK(rc) ((rc) & (ESYNCH_OK_ATOMIC | ESYNCH_OK_BLOCKED)) |
42 | #define SYNCH_OK(rc) ((rc) & (ESYNCH_OK_ATOMIC | ESYNCH_OK_BLOCKED)) |
43 | 43 | ||
44 | #endif |
44 | #endif |