Scheduler lock: provide additional info on failure
This commit is contained in:
@@ -46,19 +46,19 @@
|
|||||||
#define NR_SCHED_LOCK(lock) \
|
#define NR_SCHED_LOCK(lock) \
|
||||||
do { \
|
do { \
|
||||||
int rc = pthread_mutex_lock(lock); \
|
int rc = pthread_mutex_lock(lock); \
|
||||||
AssertFatal(rc == 0, "error while locking scheduler mutex\n"); \
|
AssertFatal(rc == 0, "error while locking scheduler mutex, pthread_mutex_lock() returned %d\n", rc); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define NR_SCHED_UNLOCK(lock) \
|
#define NR_SCHED_UNLOCK(lock) \
|
||||||
do { \
|
do { \
|
||||||
int rc = pthread_mutex_unlock(lock); \
|
int rc = pthread_mutex_unlock(lock); \
|
||||||
AssertFatal(rc == 0, "error while locking scheduler mutex\n"); \
|
AssertFatal(rc == 0, "error while locking scheduler mutex, pthread_mutex_unlock() returned %d\n", rc); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define NR_SCHED_ENSURE_LOCKED(lock)\
|
#define NR_SCHED_ENSURE_LOCKED(lock)\
|
||||||
do {\
|
do {\
|
||||||
int rc = pthread_mutex_trylock(lock); \
|
int rc = pthread_mutex_trylock(lock); \
|
||||||
AssertFatal(rc == EBUSY, "this function should be called with the scheduler mutex locked\n");\
|
AssertFatal(rc == EBUSY, "this function should be called with the scheduler mutex locked, pthread_mutex_trylock() returned %d\n", rc);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/* Commmon */
|
/* Commmon */
|
||||||
|
|||||||
Reference in New Issue
Block a user