28 #ifndef _util_group_thread_h
29 #define _util_group_thread_h
31 #include <util/class/class.h>
46 virtual void lock() =0;
66 void unlock() {
if (locked_) { lock_->unlock(); locked_ =
false; } }
68 void lock() {
if (!locked_) { lock_->lock(); locked_ =
true; } }
80 static void *run_Thread_run(
void*thread);
83 virtual void run() =0;
109 void delete_threads();
164 void *Thread__run_Thread_run(
void*thread);
~ThreadLockHolder()
Releases the lock if it is still held.
Definition: thread.h:70
The ProcThreadGrp class privides a concrete thread group appropriate for an environment where there i...
Definition: thread.h:146
A template class that maintains references counts.
Definition: ref.h:361
virtual void unlock()=0
Release the lock.
The Thread abstract class defines an interface which must be implemented by classes wishing to be run...
Definition: thread.h:75
void lock()
Acquire the lock once more.
Definition: thread.h:68
static void set_default_threadgrp(const Ref< ThreadGrp > &)
Sets the default ThreadGrp.
virtual void add_thread(int threadnum, Thread *thread)
Assigns a Thread object to each thread.
ThreadGrp * clone(int nthread=-1)
Create a ThreadGrp like the current one.
virtual void lock()=0
Obtain the lock.
static ThreadGrp * initial_threadgrp(int &argc, char **argv)
Create a ThreadGrp.
int nthread() const
The number of threads that will be run by start_thread.
Definition: thread.h:107
Ref< ThreadLock > new_lock()
Return a local object.
virtual int wait_threads()=0
Wait for all the threads to complete.
virtual Ref< ThreadLock > new_lock()=0
Return a local object.
void unlock()
Release the lock before the DTOR is called, if it is still held.
Definition: thread.h:66
The ThreadGrp abstract class provides a means to manage separate threads of control.
Definition: thread.h:88
int start_threads()
Starts the threads running.
virtual ThreadGrp * clone(int nthread=-1)
Create a ThreadGrp like the current one.
virtual int start_threads()=0
Starts the threads running.
virtual void run()=0
This is called with the Thread is run from a ThreadGrp.
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition: class.h:233
int wait_threads()
Wait for all the threads to complete.
The ThreadLock abstract class provides mutex locks to be used in conjunction with ThreadGrp's.
Definition: thread.h:40
ThreadLockHolder(const Ref< ThreadLock > &l)
Acquires the lock.
Definition: thread.h:61
Acquire a lock on creation and release it on destruction.
Definition: thread.h:56
The base class for all reference counted objects.
Definition: ref.h:192
static ThreadGrp * get_default_threadgrp()
Returns the default ThreadGrp.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
Generated at Sun Jan 26 2020 23:24:01 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.