Changeset 18748
- Timestamp:
- Jul 25, 2008, 5:47:14 PM (18 years ago)
- Location:
- branches/eam_branch_20080719/pswarp/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080719/pswarp/src/Makefile.am
r18622 r18748 17 17 pswarpSetMaskBits.c \ 18 18 pswarpTransformReadout_Opt.c \ 19 pswarpThreadLauncher.c \ 19 20 pswarpVersion.c 20 21 -
branches/eam_branch_20080719/pswarp/src/pswarp.c
r17781 r18748 16 16 17 17 psLibInit(NULL); 18 19 // create the thread pool with 4 threads, supplying our thread launcher function 20 psThreadPoolInit (4, &pswarpThreadLauncher); 21 22 srand48(0); 23 24 for (int i = 0; i < 10; i++) { 25 // allocate a job which takes two arguments 26 // XXX probably don't need to pre-specify the number of args 27 psThreadJob *job = psThreadJobAlloc ("THREAD_TEST", 2); 28 29 // construct the arguments for this job 30 char *arg1 = NULL; 31 char *arg2 = NULL; 32 psStringAppend (&arg1, "arg1.%d", i); 33 psStringAppend (&arg2, "arg2.%d", i); 34 psArrayAdd (job->args, 1, arg1); 35 psArrayAdd (job->args, 1, arg2); 36 37 psThreadJobAddToQueue (job); 38 } 39 if (!psThreadPoolWait ()) { 40 fprintf (stderr, "error in a threaded job\n"); 41 exit (1); 42 } 43 fprintf (stderr, "success for threaded jobs\n"); 44 exit (0); 18 45 19 46 // model inits are needed in pmSourceIO -
branches/eam_branch_20080719/pswarp/src/pswarp.h
r18622 r18748 68 68 ); 69 69 70 // thread launcher for this program 71 void *pswarpThreadLauncher (void *data);
Note:
See TracChangeset
for help on using the changeset viewer.
