Loading...
Searching...
No Matches
LibThread::ProcTrigger Class Reference

## Public Member Functions

| ProcTrigger (const char *p)
virtual bool | ready ()
virtual bool | accept (leftv arg)
virtual void | activate (leftv arg)
virtual void | execute ()
Public Member Functions inherited from LibThread::Trigger
| Trigger ()
Public Member Functions inherited from LibThread::Job
| Job ()
| ~Job ()
void | addDep (Job *job)
void | addDep (vector< Job * > &jobs)
void | addDep (long ndeps, Job **jobs)
void | addNotify (vector< Job * > &jobs)
void | addNotify (Job *job)
void | run ()
Public Member Functions inherited from LibThread::SharedObject
| SharedObject ()
virtual | ~SharedObject ()
void | set_type (int type_init)
int | get_type ()
void | set_name (std::string &name_init)
void | set_name (const char *s)
std::string & | get_name ()
void | incref (int by=1)
long | decref ()
long | getref ()
virtual BOOLEAN | op2 (int op, leftv res, leftv a1, leftv a2)
virtual BOOLEAN | op3 (int op, leftv res, leftv a1, leftv a2, leftv a3)

## Private Attributes

string | procname
bool | success

## Additional Inherited Members

Data Fields inherited from LibThread::Job
ThreadPool * | pool
long | prio
size_t | id
long | pending_index
vector< Job * > | deps
vector< Job * > | notify
vector< Trigger * > | triggers
vector< string > | args
string | result
void * | data
bool | fast
bool | done
bool | queued
bool | running
bool | cancelled

## Detailed Description

Definition at line 2082 of file shared.cc.

## Constructor & Destructor Documentation

## ProcTrigger()

LibThread::ProcTrigger::ProcTrigger | ( | const char * | p | ) |

inline

Definition at line 2087 of file shared.cc.

: Trigger(), procname(p), success(false) {
}
p
int p
Definition cfModGcd.cc:4086
LibThread::ProcTrigger::success
bool success
Definition shared.cc:2085
LibThread::ProcTrigger::procname
string procname
Definition shared.cc:2084
LibThread::Trigger::Trigger
Trigger()
Definition shared.cc:1597

## Member Function Documentation

## accept()

virtual bool LibThread::ProcTrigger::accept | ( | leftv | arg | ) |

inline virtual

Implements LibThread::Trigger.

Definition at line 2093 of file shared.cc.

{
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101

## activate()

virtual void LibThread::ProcTrigger::activate | ( | leftv | arg | ) |

inline virtual

Implements LibThread::Trigger.

Definition at line 2096 of file shared.cc.

{
if (!ready()) {
pool->scheduler->lock.unlock();
vector<leftv> argv;
for (unsigned i = 0; i < args.size(); i++) {
appendArg(argv, args[i]);
}
int error = false;
while (arg) {
appendArgCopy(argv, arg);
arg = arg->next;
}
sleftv val;
if (!error)
error = executeProc(val, procname.c_str(), argv);
if (!error) {
if (val.Typ() == NONE || (val.Typ() == INT_CMD &&
(long) val.Data()))
{
success = true;
}
val.CleanUp();
}
pool->scheduler->lock.lock();
}
}
i
int i
Definition cfEzgcd.cc:132
LibThread::Job::args
vector< string > args
Definition shared.cc:1553
LibThread::Job::pool
ThreadPool * pool
Definition shared.cc:1546
LibThread::ProcTrigger::ready
virtual bool ready()
Definition shared.cc:2089
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::Data
void * Data()
Definition subexpr.cc:1192
sleftv::next
leftv next
Definition subexpr.h:86
sleftv::CleanUp
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
error
#define error(a)
Definition mpr_numeric.cc:966
LibThread::appendArgCopy
static void appendArgCopy(vector< leftv > &argv, leftv arg)
Definition shared.cc:737
LibThread::appendArg
static void appendArg(vector< leftv > &argv, string &s)
Definition shared.cc:723
LibThread::executeProc
static BOOLEAN executeProc(sleftv &result, const char *procname, const vector< leftv > &argv)
Definition shared.cc:744
INT_CMD
@ INT_CMD
Definition tok.h:96
NONE
#define NONE
Definition tok.h:223

## execute()

virtual void LibThread::ProcTrigger::execute | ( |  | ) |

inline virtual

Implements LibThread::Job.

Definition at line 2122 of file shared.cc.

{
// do nothing
}

## ready()

virtual bool LibThread::ProcTrigger::ready | ( |  | ) |

inline virtual

Reimplemented from LibThread::Job.

Definition at line 2089 of file shared.cc.

{
if (!Trigger::ready()) return false;
return success;
}
LibThread::Job::ready
virtual bool ready()
Definition shared.cc:1600

## Field Documentation

## procname

string LibThread::ProcTrigger::procname

private

Definition at line 2084 of file shared.cc.

## success

bool LibThread::ProcTrigger::success

private

Definition at line 2085 of file shared.cc.

The documentation for this class was generated from the following file:

- Singular/dyn_modules/systhreads/shared.cc