Ticket #7755: 7755.patch

File 7755.patch, 2.2 KB (added by viboes, 10 years ago)
  • shared_mutex.hpp

     
    471471                {
    472472                    for(;;)
    473473                    {
     474                        bool must_notify = false;
    474475                        state_data new_state=old_state;
    475476                        if(new_state.shared_count || new_state.exclusive)
    476477                        {
     
    479480                                if(!--new_state.exclusive_waiting)
    480481                                {
    481482                                    new_state.exclusive_waiting_blocked=false;
     483                                    must_notify = true;
    482484                                }
    483485                            }
    484486                        }
     
    488490                        }
    489491
    490492                        state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
     493                        if (must_notify)
     494                        {
     495                          BOOST_VERIFY(detail::win32::ReleaseSemaphore(semaphores[unlock_sem],1,0)!=0);
     496                        }
     497
    491498                        if(current_state==old_state)
    492499                        {
    493500                            break;
     
    580587            {
    581588              for(;;)
    582589              {
     590                bool must_notify = false;
    583591                state_data new_state=old_state;
    584592                if(new_state.shared_count || new_state.exclusive)
    585593                {
     
    588596                    if(!--new_state.exclusive_waiting)
    589597                    {
    590598                      new_state.exclusive_waiting_blocked=false;
     599                      must_notify = true;
    591600                    }
    592601                  }
    593602                }
     
    597606                }
    598607
    599608                state_data const current_state=interlocked_compare_exchange(&state,new_state,old_state);
     609                if (must_notify)
     610                {
     611                  BOOST_VERIFY(detail::win32::ReleaseSemaphore(semaphores[unlock_sem],1,0)!=0);
     612                }
    600613                if(current_state==old_state)
    601614                {
    602615                  break;