MCPcopy Create free account
hub / github.com/devosoft/avida / PerformUpdate

Method PerformUpdate

avida-core/source/data/Manager.cc:421–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419
420
421void Avida::Data::Manager::PerformUpdate(Context&, Update current_update)
422{
423 m_current_value_mutex.Lock();
424 m_current_values.Clear();
425 m_current_value_mutex.Unlock();
426
427 m_rwlock.ReadLock();
428
429 // Update all of the active providers
430 for (int i = 0; i < m_active_providers.GetSize(); i++) m_active_providers[i]->UpdateProvidedValues(current_update);
431
432 // Notify recorders that new data is available
433 DataRetrievalFunctor drf(this, &Manager::GetCurrentValue);
434
435 // Lock recorder mutex before releasing RWLock, so that only recorders that have values will be notified
436 m_recorder_mutex.Lock();
437
438 // Release RWLock before notification to prevent double RWLocking deadlock during recorder attachment
439 m_rwlock.ReadUnlock();
440
441 for (Apto::Set<RecorderPtr>::Iterator it = m_recorders.Begin(); it.Next();) {
442 (*it.Get())->NotifyData(current_update, drf);
443 }
444 m_recorder_mutex.Unlock();
445}
446
447Avida::Data::PackagePtr Avida::Data::Manager::GetCurrentValue(const DataID& data_id) const
448{

Callers

nothing calls this directly

Calls 8

UnlockMethod · 0.80
ClearMethod · 0.45
GetSizeMethod · 0.45
UpdateProvidedValuesMethod · 0.45
BeginMethod · 0.45
NextMethod · 0.45
NotifyDataMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected