rem: if (master.owner == self && --master.count == 0) { master.owner = 0;
add: if (pthread_equal(master.owner, self) && --master.count == 0) { master.owner = MASTER_NO_OWNER;
context: Ns_MasterUnlock(void){    static char *func = "Ns_MasterUnlock";    pthread_t self = pthread_self();    int err;    err = pthread_mutex_lock(&master.lock);    if (err != 0) {        NsThreadFatal(func, "pthread_mutex_lock", err);    }    if (master.owner == self && --master.count == 0) {	master.owner = 0;	err = pthread_cond_signal(&master.cond);	if (err != 0) {	    NsThreadFatal(func, "pthread_cond_signal", err);	}    }    err = pthread_mutex_unlock(&master.lock);    if (err != 0) {        NsThreadFatal(func, "pthread_mutex_unlock", err);    }}