28 #ifndef _util_group_thread_h
29 #define _util_group_thread_h
35 #include <util/class/class.h>
50 virtual void lock() =0;
70 void unlock() {
if (locked_) { lock_->unlock(); locked_ =
false; } }
72 void lock() {
if (!locked_) { lock_->lock(); locked_ =
true; } }
84 static void *run_Thread_run(
void*thread);
87 virtual void run() =0;
113 void delete_threads();
131 static ThreadGrp * get_default_threadgrp();
132 static ThreadGrp * initial_threadgrp(
int &argc,
char ** argv);
157 void *Thread__run_Thread_run(
void*thread);
~ThreadLockHolder()
Releases the lock if it is still held.
Definition: thread.h:74
The ProcThreadGrp class privides a concrete thread group appropriate for an environment where there i...
Definition: thread.h:139
A template class that maintains references counts.
Definition: ref.h:332
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:79
void lock()
Acquire the lock once more.
Definition: thread.h:72
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.
int nthread() const
The number of threads that will be run by start_thread.
Definition: thread.h:111
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:70
The ThreadGrp abstract class provides a means to manage separate threads of control.
Definition: thread.h:92
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:244
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:44
ThreadLockHolder(const Ref< ThreadLock > &l)
Acquires the lock.
Definition: thread.h:65
Acquire a lock on creation and release it on destruction.
Definition: thread.h:60
The base class for all reference counted objects.
Definition: ref.h:194
Generated at Sun Jan 26 2020 23:33:05 for MPQC
2.3.1 using the documentation package Doxygen
1.8.16.