Explorar el Código

优化event

tags/v2.9.7
tearshark hace 4 años
padre
commit
ece8c19952
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6
    3
      librf/src/event_v2.inl

+ 6
- 3
librf/src/event_v2.inl Ver fichero

@@ -35,9 +35,12 @@ RESUMEF_NS
bool try_wait_one() noexcept
{
if (_counter.fetch_add(-1, std::memory_order_acq_rel) > 0)
return true;
_counter.fetch_add(1);
if (_counter.load(std::memory_order_acquire) > 0)
{
if (_counter.fetch_add(-1, std::memory_order_acq_rel) > 0)
return true;
_counter.fetch_add(1);
}
return false;
}

Cargando…
Cancelar
Guardar