Changeset 18813
- Timestamp:
- Jul 30, 2008, 6:03:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080719/pswarp/src/pswarpThreadLauncher.c
r18753 r18813 1 1 # include "pswarp.h" 2 // XXX add in a thread exit api (set a local 'exit' variable)3 4 bool pswarpThreadTest (psArray *args) {5 6 pthread_t id = pthread_self();7 8 // int dtime = 500000*drand48();9 10 int dtime = (drand48() > 0.5) ? 500000 : 10000;11 bool status = (drand48() > 0.9) ? false : true;12 13 usleep (dtime);14 fprintf (stderr, "in thread %lu, args %s and %s, dtime %d, status %d\n", id, (char *) args->data[0], (char *) args->data[1], dtime, status);15 16 return status;17 }18 2 19 3 // each thread runs this function, starting a new job when it finished with an old one … … 42 26 43 27 // list all allowed job types here 44 if (!strcmp (job->type, "THREAD_TEST")) {45 bool status = pswarpThreadTest (job->args);46 if (!status) {47 self->fault = true;48 }49 // we do not have to lock here because this transition is not tied to the job queue50 self->busy = false;51 continue;52 }53 54 // list all allowed job types here55 28 if (!strcmp (job->type, "PSWARP_TRANSFORM_TILE")) { 56 29 pswarpTransformTileArgs *args = job->args->data[0];
Note:
See TracChangeset
for help on using the changeset viewer.
