Lines Matching refs:new_state

100                 state_data new_state=old_state;  in try_lock_shared()  local
101 if(!new_state.exclusive && !new_state.exclusive_waiting_blocked) in try_lock_shared()
103 ++new_state.shared_count; in try_lock_shared()
104 if(!new_state.shared_count) in try_lock_shared()
110 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in try_lock_shared()
138 state_data new_state=old_state; in timed_lock_shared() local
139 if(new_state.exclusive || new_state.exclusive_waiting_blocked) in timed_lock_shared()
141 ++new_state.shared_waiting; in timed_lock_shared()
142 if(!new_state.shared_waiting) in timed_lock_shared()
149 ++new_state.shared_count; in timed_lock_shared()
150 if(!new_state.shared_count) in timed_lock_shared()
156 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in timed_lock_shared()
174 state_data new_state=old_state; in timed_lock_shared() local
175 if(new_state.exclusive || new_state.exclusive_waiting_blocked) in timed_lock_shared()
177 if(new_state.shared_waiting) in timed_lock_shared()
179 --new_state.shared_waiting; in timed_lock_shared()
184 ++new_state.shared_count; in timed_lock_shared()
185 if(!new_state.shared_count) in timed_lock_shared()
191 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in timed_lock_shared()
215 state_data new_state=old_state; in unlock_shared() local
216 bool const last_reader=!--new_state.shared_count; in unlock_shared()
220 if(new_state.upgrade) in unlock_shared()
222 new_state.upgrade=false; in unlock_shared()
223 new_state.exclusive=true; in unlock_shared()
227 if(new_state.exclusive_waiting) in unlock_shared()
229 --new_state.exclusive_waiting; in unlock_shared()
230 new_state.exclusive_waiting_blocked=false; in unlock_shared()
232 new_state.shared_waiting=0; in unlock_shared()
236 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock_shared()
272 state_data new_state=old_state; in try_lock() local
273 if(new_state.shared_count || new_state.exclusive) in try_lock()
279 new_state.exclusive=true; in try_lock()
282 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in try_lock()
301 state_data new_state=old_state; in timed_lock() local
302 if(new_state.shared_count || new_state.exclusive) in timed_lock()
304 ++new_state.exclusive_waiting; in timed_lock()
305 if(!new_state.exclusive_waiting) in timed_lock()
310 new_state.exclusive_waiting_blocked=true; in timed_lock()
314 new_state.exclusive=true; in timed_lock()
317 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in timed_lock()
334 state_data new_state=old_state; in timed_lock() local
335 if(new_state.shared_count || new_state.exclusive) in timed_lock()
337 if(new_state.exclusive_waiting) in timed_lock()
339 if(!--new_state.exclusive_waiting) in timed_lock()
341 new_state.exclusive_waiting_blocked=false; in timed_lock()
347 new_state.exclusive=true; in timed_lock()
350 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in timed_lock()
372 state_data new_state=old_state; in unlock() local
373 new_state.exclusive=false; in unlock()
374 if(new_state.exclusive_waiting) in unlock()
376 --new_state.exclusive_waiting; in unlock()
377 new_state.exclusive_waiting_blocked=false; in unlock()
379 new_state.shared_waiting=0; in unlock()
381 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock()
398 state_data new_state=old_state; in lock_upgrade() local
399 … if(new_state.exclusive || new_state.exclusive_waiting_blocked || new_state.upgrade) in lock_upgrade()
401 ++new_state.shared_waiting; in lock_upgrade()
402 if(!new_state.shared_waiting) in lock_upgrade()
409 ++new_state.shared_count; in lock_upgrade()
410 if(!new_state.shared_count) in lock_upgrade()
414 new_state.upgrade=true; in lock_upgrade()
417 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in lock_upgrade()
439 state_data new_state=old_state; in try_lock_upgrade() local
440 if(new_state.exclusive || new_state.exclusive_waiting_blocked || new_state.upgrade) in try_lock_upgrade()
446 ++new_state.shared_count; in try_lock_upgrade()
447 if(!new_state.shared_count) in try_lock_upgrade()
451 new_state.upgrade=true; in try_lock_upgrade()
454 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in try_lock_upgrade()
469 state_data new_state=old_state; in unlock_upgrade() local
470 new_state.upgrade=false; in unlock_upgrade()
471 bool const last_reader=!--new_state.shared_count; in unlock_upgrade()
475 if(new_state.exclusive_waiting) in unlock_upgrade()
477 --new_state.exclusive_waiting; in unlock_upgrade()
478 new_state.exclusive_waiting_blocked=false; in unlock_upgrade()
480 new_state.shared_waiting=0; in unlock_upgrade()
483 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock_upgrade()
501 state_data new_state=old_state; in unlock_upgrade_and_lock() local
502 bool const last_reader=!--new_state.shared_count; in unlock_upgrade_and_lock()
506 new_state.upgrade=false; in unlock_upgrade_and_lock()
507 new_state.exclusive=true; in unlock_upgrade_and_lock()
510 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock_upgrade_and_lock()
528 state_data new_state=old_state; in unlock_and_lock_upgrade() local
529 new_state.exclusive=false; in unlock_and_lock_upgrade()
530 new_state.upgrade=true; in unlock_and_lock_upgrade()
531 ++new_state.shared_count; in unlock_and_lock_upgrade()
532 if(new_state.exclusive_waiting) in unlock_and_lock_upgrade()
534 --new_state.exclusive_waiting; in unlock_and_lock_upgrade()
535 new_state.exclusive_waiting_blocked=false; in unlock_and_lock_upgrade()
537 new_state.shared_waiting=0; in unlock_and_lock_upgrade()
539 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock_and_lock_upgrade()
554 state_data new_state=old_state; in unlock_and_lock_shared() local
555 new_state.exclusive=false; in unlock_and_lock_shared()
556 ++new_state.shared_count; in unlock_and_lock_shared()
557 if(new_state.exclusive_waiting) in unlock_and_lock_shared()
559 --new_state.exclusive_waiting; in unlock_and_lock_shared()
560 new_state.exclusive_waiting_blocked=false; in unlock_and_lock_shared()
562 new_state.shared_waiting=0; in unlock_and_lock_shared()
564 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock_and_lock_shared()
579 state_data new_state=old_state; in unlock_upgrade_and_lock_shared() local
580 new_state.upgrade=false; in unlock_upgrade_and_lock_shared()
581 if(new_state.exclusive_waiting) in unlock_upgrade_and_lock_shared()
583 --new_state.exclusive_waiting; in unlock_upgrade_and_lock_shared()
584 new_state.exclusive_waiting_blocked=false; in unlock_upgrade_and_lock_shared()
586 new_state.shared_waiting=0; in unlock_upgrade_and_lock_shared()
588 … state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state); in unlock_upgrade_and_lock_shared()