workerpool.h
Go to the documentation of this file.
1 /* Copyright (C) 2013-2016, The Regents of The University of Michigan.
2 All rights reserved.
3 
4 This software was developed in the APRIL Robotics Lab under the
5 direction of Edwin Olson, ebolson@umich.edu. This software may be
6 available under alternative licensing terms; contact the address above.
7 
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
10 
11 1. Redistributions of source code must retain the above copyright notice, this
12  list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 The views and conclusions contained in the software and documentation are those
29 of the authors and should not be interpreted as representing official policies,
30 either expressed or implied, of the Regents of The University of Michigan.
31 */
32 
33 #ifndef _WORKERPOOL_H
34 #define _WORKERPOOL_H
35 
36 #include "zarray.h"
37 
38 typedef struct workerpool workerpool_t;
39 
40 // as a special case, if nthreads==1, no additional threads are
41 // created, and workerpool_run will run synchronously.
44 
45 void workerpool_add_task(workerpool_t *wp, void (*f)(void *p), void *p);
46 
47 // runs all added tasks, waits for them to complete.
49 
50 // same as workerpool_run, except always single threaded. (mostly for debugging).
52 
54 
56 
57 #endif
int workerpool_get_nthreads(workerpool_t *wp)
Definition: workerpool.c:157
void workerpool_run_single(workerpool_t *wp)
Definition: workerpool.c:171
void workerpool_add_task(workerpool_t *wp, void(*f)(void *p), void *p)
Definition: workerpool.c:162
int nthreads
Definition: workerpool.c:47
void workerpool_run(workerpool_t *wp)
Definition: workerpool.c:183
void workerpool_destroy(workerpool_t *wp)
Definition: workerpool.c:130
int workerpool_get_nprocs()
Definition: workerpool.c:207
workerpool_t * workerpool_create(int nthreads)
Definition: workerpool.c:103


apriltags2
Author(s): Danylo Malyuta
autogenerated on Fri Oct 19 2018 04:02:32