sched.h Source File

| http://www.sim.no/ http://www.coin3d.org/

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

sched.h
1 #ifndef CC_SCHED_H
2 #define CC_SCHED_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/C/basic.h> /* COIN_DLL_API */
28 #include <Inventor/C/threads/common.h> /* cc_sched */
29
30 /* ********************************************************************** */
31
32 /* Implementation note: it is important that this header file can be
33 included even when Coin was built with no threads support.
34
35 (This simplifies client code, as we get away with far less #ifdef
36 HAVE_THREADS wrapping.) */
37
38 /* ********************************************************************** */
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43
44 typedef void cc_sched_f(void * closure);
45
46 /* ********************************************************************** */
47
48 COIN_DLL_API cc_sched * cc_sched_construct(int numthreads);
49 COIN_DLL_API void cc_sched_destruct(cc_sched * sched);
50 COIN_DLL_API void cc_sched_set_num_threads(cc_sched * sched, int num);
51 COIN_DLL_API int cc_sched_get_num_threads(cc_sched * sched);
52
53 COIN_DLL_API uint32_t cc_sched_schedule(cc_sched * sched,
54 cc_sched_f * workfunc,
55 void * closure,
56 float priority);
57 COIN_DLL_API SbBool cc_sched_unschedule(cc_sched * sched,
58 uint32_t schedid);
59 COIN_DLL_API void cc_sched_wait_all(cc_sched * sched);
60 COIN_DLL_API int cc_sched_get_num_remaining(cc_sched * sched);
61 COIN_DLL_API void cc_sched_set_num_allowed(cc_sched * sched, int num);
62 COIN_DLL_API void cc_sched_change_priority(cc_sched * sched,
63 uint32_t schedid,
64 float priority);
65
66 /* ********************************************************************** */
67
68 #ifdef __cplusplus
69 } /* extern "C" */
70 #endif /* __cplusplus */
71
72 #endif /* ! CC_SCHED_H */

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.