CernVM-FS
2.12.0
|
#include <future.h>
Public Member Functions | |
Future () | |
~Future () | |
void | Set (const T &object) |
T & | Get () |
const T & | Get () const |
Private Member Functions | |
void | Wait () const |
Private Member Functions inherited from SingleCopy | |
SingleCopy () | |
Private Attributes | |
T | object_ |
pthread_mutex_t | mutex_ |
pthread_cond_t | object_set_ |
bool | object_was_set_ |
This file is part of the CernVM File System. 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 |
|
inline |
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 66 of file future.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().
|
inline |
|
inline |
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 53 of file future.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().
|
inlineprivate |
|
mutableprivate |
|
mutableprivate |
|
private |