От: | Аноним | ||
Дата: | 03.05.10 09:28 | ||
Оценка: |
SharedLockable Concept
void lock_shared()
bool try_lock_shared()
bool timed_lock_shared(boost::system_time const& abs_time)
void unlock_shared()
The SharedLockable concept is a refinement of the TimedLockable concept that allows for shared ownership as well as exclusive ownership. This is the standard multiple-reader / single-write model: at most one thread can have exclusive ownership, and if any thread does have exclusive ownership, no other threads can have shared or exclusive ownership. Alternatively, many threads may have shared ownership.
Mutex m;
void Foo1()
{
m.lock();
m.unlock();
}
begin_thread( Foo1 );
begin_thread( Foo1 );