Commit 79277a2d authored by samaingw's avatar samaingw

CyLock: systematic error messages when doing a lock op on NULL

parent 3b3e8ff9
...@@ -125,15 +125,30 @@ ...@@ -125,15 +125,30 @@
} }
static inline void _Cy_RLOCK(CyObject *op) { static inline void _Cy_RLOCK(CyObject *op) {
op->CyObject_RLOCK(); if (op != NULL) {
op->CyObject_RLOCK();
}
else {
fprintf(stderr, "ERROR: trying to read lock NULL !\n");
}
} }
static inline void _Cy_WLOCK(CyObject *op) { static inline void _Cy_WLOCK(CyObject *op) {
op->CyObject_WLOCK(); if (op != NULL) {
op->CyObject_WLOCK();
}
else {
fprintf(stderr, "ERROR: trying to write lock NULL !\n");
}
} }
static inline void _Cy_UNLOCK(CyObject *op) { static inline void _Cy_UNLOCK(CyObject *op) {
if (op != NULL) op->CyObject_UNLOCK(); if (op != NULL) {
op->CyObject_UNLOCK();
}
else {
fprintf(stderr, "ERROR: trying to unlock NULL !\n");
}
} }
static inline int _Cy_TRYRLOCK(CyObject *op) { static inline int _Cy_TRYRLOCK(CyObject *op) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment