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

## Public Member Functions

| KernelJob (void(*func)(leftv result, leftv arg))
virtual void | execute ()
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)
virtual bool | ready ()
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

void(* | cfunc )(leftv result, leftv arg)

## 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 2400 of file shared.cc.

## Constructor & Destructor Documentation

## KernelJob()

LibThread::KernelJob::KernelJob | ( | void(* | func )(leftv result, leftv arg) | ) |

inline

Definition at line 2404 of file shared.cc.

: cfunc(func) { }
LibThread::KernelJob::cfunc
void(* cfunc)(leftv result, leftv arg)
Definition shared.cc:2402

## Member Function Documentation

## execute()

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

inline virtual

Implements LibThread::Job.

Definition at line 2405 of file shared.cc.

{
vector<leftv> argv;
for (unsigned i = 0; i <args.size(); i++) {
appendArg(argv, args[i]);
}
for (unsigned i = 0; i < deps.size(); i++) {
appendArg(argv, deps[i]->result);
}
sleftv val;
memset(&val, 0, sizeof(val));
if (argv.size() > 0) {
leftv *tail = &argv[0]->next;
for (unsigned i = 1; i < argv.size(); i++) {
*tail = argv[i];
tail = &(*tail)->next;
}
*tail = NULL;
}
cfunc(&val, argv[0]);
result = (LinTree::to_string(&val));
val.CleanUp();
}
i
int i
Definition cfEzgcd.cc:132
LibThread::Job::args
vector< string > args
Definition shared.cc:1553
LibThread::Job::deps
vector< Job * > deps
Definition shared.cc:1550
LibThread::Job::result
string result
Definition shared.cc:1554
sleftv::next
leftv next
Definition subexpr.h:86
sleftv::CleanUp
void CleanUp(ring r=currRing)
Definition subexpr.cc:351
LibThread::appendArg
static void appendArg(vector< leftv > &argv, string &s)
Definition shared.cc:723
LinTree::to_string
std::string to_string(leftv val)
Definition lintree.cc:843
NULL
#define NULL
Definition omList.c:12
leftv
sleftv * leftv
Definition structs.h:53

## Field Documentation

## cfunc

void(* LibThread::KernelJob::cfunc) (leftv result, leftv arg)

private

Definition at line 2402 of file shared.cc.

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

- Singular/dyn_modules/systhreads/shared.cc