Ramanath S(deleted)
02/01/2015 10:59 PM
post113173
|
We have a scenario like when lower priority thread is using mutex lock and higher priority thread arrives, it should
wait till the lower priority thread lock is unlocked, we use the below code for the same, but it is not working please
help us in this regard,
pthread_mutexattr_t bb_mutex_attr;
rv = pthread_mutexattr_init(&bb_mutex_attr);
rv = pthread_mutexattr_setprioceiling(&bb_mutex_attr, 63);
rv = pthread_mutexattr_setprotocol(&bb_mutex_attr, PTHREAD_PRIO_PROTECT );
// Initialize the Mutex for bb_Lock/Unlock
rv = pthread_mutex_init(&bb_mutex, &bb_mutex_attr);
rv = pthread_mutex_setprioceiling(&bb_mutex, HIGHEST_PBO_PRIORITY, &oldceiling);
|
|
|