comparison dvdnav.c @ 263:d999338cab17 src

prevent races
author mroi
date Wed, 20 Apr 2005 16:05:43 +0000
parents 7708d2fc1745
children 8c86b61eb06f
comparison
equal deleted inserted replaced
262:7708d2fc1745 263:d999338cab17
1092 * the union of two of those bitfields so to make this quicker 1092 * the union of two of those bitfields so to make this quicker
1093 * than performing 32 ORs, we will access them as 32bits words. 1093 * than performing 32 ORs, we will access them as 32bits words.
1094 */ 1094 */
1095 uint32_t ops=0; 1095 uint32_t ops=0;
1096 1096
1097 if(!this) {
1098 printerr("Passed a NULL pointer.");
1099 return *(user_ops_t*)&ops;
1100 }
1101 if(!this->started) {
1102 printerr("Virtual DVD machine not started.");
1103 return *(user_ops_t*)&ops;
1104 }
1105
1106 pthread_mutex_lock(&this->vm_lock);
1097 ops|=*(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl; 1107 ops|=*(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl;
1098 1108
1099 if(this->vm && this->vm->state.pgc) 1109 if(this->vm && this->vm->state.pgc)
1100 ops|=*(uint32_t*)&this->vm->state.pgc->prohibited_ops; 1110 ops|=*(uint32_t*)&this->vm->state.pgc->prohibited_ops;
1111 pthread_mutex_unlock(&this->vm_lock);
1101 1112
1102 return *(user_ops_t*)&ops; 1113 return *(user_ops_t*)&ops;
1103 } 1114 }