![]() |
CernVM-FS
2.11.0
|
#include <concurrency.h>
Public Member Functions | |
Future () | |
virtual | ~Future () |
void | Set (const T &object) |
T & | Get () |
const T & | Get () const |
Protected Member Functions | |
void | Wait () const |
Private Attributes | |
T | object_ |
pthread_mutex_t | mutex_ |
pthread_cond_t | object_set_ |
bool | object_was_set_ |
Additional Inherited Members | |
![]() | |
SingleCopy () | |
This is a simple implementation of a Future wrapper template. It is used as a proxy for results that are computed asynchronously and might not be available on the first access. Since this is a very simple implementation one needs to use the Future's Get() and Set() methods to obtain the containing data resp. to write it. Note: More than a single call to Set() is prohibited! If Get() is called before Set() the calling thread will block until the value has been set by a different thread.
T | the value type wrapped by this Future template |
Definition at line 67 of file concurrency.h.
This file is part of the CernVM File System.
Definition at line 21 of file concurrency_impl.h.
Definition at line 29 of file concurrency_impl.h.
T & Future< T >::Get | ( | ) |
Retrieves the wrapped value object. If the value is not yet available it will automatically block until a different thread calls Set().
Definition at line 56 of file concurrency_impl.h.
Referenced by swissknife::CommandTag::CloseAndPublishHistory(), swissknife::CommandMigrate::DoMigrationAndCommit(), upload::SessionContextBase::Finalize(), swissknife::CommandMigrate::MigrationWorker_20x::FixNestedCatalogTransitionPoints(), swissknife::CommandMigrate::MigrationWorker_20x::GenerateCatalogStatistics(), swissknife::CommandMigrate::MigrationWorker_217::GenerateNewStatisticsCounters(), swissknife::CommandMigrate::MigrationWorker_20x::MigrateNestedCatalogMountPoints(), swissknife::CommandMigrate::StatsMigrationWorker::RepairStatisticsCounters(), SigningTool::Run(), catalog::WritableCatalogManager::SnapshotCatalogs(), swissknife::CommandMigrate::AbstractMigrationWorker< DerivedT >::UpdateNestedCatalogReferences(), swissknife::CommandMigrate::UpdateUndoTags(), and swissknife::CommandTag::UploadCatalogAndUpdateManifest().
const T & Future< T >::Get | ( | ) | const |
Definition at line 63 of file concurrency_impl.h.
void Future< T >::Set | ( | const T & | object | ) |
Save an asynchronously computed value into the Future. This potentially unblocks threads that already wait for the value.
object | the value object to be set |
Definition at line 36 of file concurrency_impl.h.
Referenced by SigningTool::CertificateUploadCallback(), swissknife::CommandMigrate::MigrationWorker_20x::FindRootEntryInformation(), swissknife::CommandMigrate::MigrationWorker_20x::GenerateCatalogStatistics(), swissknife::CommandMigrate::MigrationWorker_217::GenerateNewStatisticsCounters(), SigningTool::MetainfoUploadCallback(), swissknife::CommandMigrate::MigrationCallback(), swissknife::CommandMigrate::StatsMigrationWorker::RepairStatisticsCounters(), swissknife::CommandMigrate::UploadCallback(), swissknife::CommandTag::UploadClosure(), swissknife::CommandMigrate::UploadHistoryClosure(), and upload::SessionContext::UploadLoop().
|
protected |
|
mutableprivate |
Definition at line 92 of file concurrency.h.
Referenced by Future< T >::Future().
|
private |
Definition at line 91 of file concurrency.h.
|
mutableprivate |
Definition at line 93 of file concurrency.h.
Referenced by Future< T >::Future().
|
private |
Definition at line 94 of file concurrency.h.