Commit bebe136d authored by samaingw's avatar samaingw Committed by Xavier Thompson

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

parent 2d7783ff
......@@ -125,15 +125,30 @@
}
static inline void _Cy_RLOCK(CyObject *op) {
if (op != NULL) {
op->CyObject_RLOCK();
}
else {
fprintf(stderr, "ERROR: trying to read lock NULL !\n");
}
}
static inline void _Cy_WLOCK(CyObject *op) {
if (op != NULL) {
op->CyObject_WLOCK();
}
else {
fprintf(stderr, "ERROR: trying to write lock NULL !\n");
}
}
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) {
......
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