Ticket #232: eaccelerator-lockbug.patch
| File eaccelerator-lockbug.patch, 1.1 KB (added by terrysduncan, 3 years ago) |
|---|
-
eaccelerator.c
old new 1752 1752 mm_used_entry *p = (mm_used_entry*)EAG(used_entries); 1753 1753 if (eaccelerator_mm_instance != NULL) { 1754 1754 EACCELERATOR_UNPROTECT(); 1755 mm_unlock(eaccelerator_mm_instance->mm);1756 1755 if (p != NULL || eaccelerator_mm_instance->locks != NULL) { 1757 1756 EACCELERATOR_LOCK_RW(); 1758 1757 while (p != NULL) { -
mm.c
old new 357 357 return 1; 358 358 } 359 359 360 static int locked = 0; 361 360 362 static int mm_do_lock(mm_mutex* lock, int kind) { 361 363 int rc; 362 364 struct sembuf op; 363 365 366 if (locked) 367 { 368 ea_debug_log("eAccelerator: attempted double lock: %u\n", getpid()); 369 return 1; 370 } 371 locked++; 364 372 op.sem_num = 0; 365 373 op.sem_op = -1; 366 374 op.sem_flg = SEM_UNDO; … … 374 382 int rc; 375 383 struct sembuf op; 376 384 385 if (!locked) 386 { 387 ea_debug_log("eAccelerator: attempted double unlock: %u\n", getpid()); 388 return 1; 389 } 390 locked--; 377 391 op.sem_num = 0; 378 392 op.sem_op = 1; 379 393 op.sem_flg = SEM_UNDO;