boost::logging::locker Namespace Reference

Contains implementations of locker objects. Such a locker can lock data for read or write. More...


Classes

struct  ts_resource
struct  tss_resource_with_cache
struct  tss_resource_once_init


Detailed Description

Contains implementations of locker objects. Such a locker can lock data for read or write.

Assume you have

    struct data {
        std::string name;
        std::string desc;
    };

    some_locker<data> lk;

In order to access the locked data for write, you do:

    some_locker<data>::write obj(lk);
    obj->name = "coolio";
    obj->desc = "it works!";

In order to access the locked data for read, you do:

    some_locker<data>::read obj(lk);
    std::cout << obj->name << "/" << obj->desc;


Copyright John Torjo © 2007
Have a question/ suggestion/ comment? Send me feedback