ODE  0.13.1
 All Data Structures Functions Variables Typedefs Enumerations Groups
threading_impl.h
1 /*************************************************************************
2  * *
3  * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
4  * All rights reserved. Email: russ@q12.org Web: www.q12.org *
5  * *
6  * Builtin ODE threading implementation header. *
7  * Copyright (C) 2011-2012 Oleh Derevenko. All rights reserved. *
8  * e-mail: odar@eleks.com (change all "a" to "e") *
9  * *
10  * This library is free software; you can redistribute it and/or *
11  * modify it under the terms of EITHER: *
12  * (1) The GNU Lesser General Public License as published by the Free *
13  * Software Foundation; either version 2.1 of the License, or (at *
14  * your option) any later version. The text of the GNU Lesser *
15  * General Public License is included with this library in the *
16  * file LICENSE.TXT. *
17  * (2) The BSD-style license that is included with this library in *
18  * the file LICENSE-BSD.TXT. *
19  * *
20  * This library is distributed in the hope that it will be useful, *
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
23  * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
24  * *
25  *************************************************************************/
26 
27 /*
28  * A threading implementation built into ODE for those who does not care to
29  * or can't implement an own one.
30  */
31 
32 #ifndef _ODE_THREADING_IMPL_H_
33 #define _ODE_THREADING_IMPL_H_
34 
35 
36 #include <ode/odeconfig.h>
37 #include <ode/threading.h>
38 
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 
45 struct dxThreadingThreadPool;
46 typedef struct dxThreadingThreadPool *dThreadingThreadPoolID;
47 
48 
64 ODE_API dThreadingImplementationID dThreadingAllocateMultiThreadedImplementation();
65 
79 ODE_API const dThreadingFunctionsInfo *dThreadingImplementationGetFunctions(dThreadingImplementationID impl);
80 
107 ODE_API void dThreadingImplementationShutdownProcessing(dThreadingImplementationID impl);
108 
125 ODE_API void dThreadingImplementationCleanupForRestart(dThreadingImplementationID impl);
126 
139 ODE_API void dThreadingFreeImplementation(dThreadingImplementationID impl);
140 
141 
142 typedef void (dThreadReadyToServeCallback)(void *callback_context);
143 
166 ODE_API void dExternalThreadingServeMultiThreadedImplementation(dThreadingImplementationID impl,
167  dThreadReadyToServeCallback *readiness_callback/*=NULL*/, void *callback_context/*=NULL*/);
168 
169 
195 ODE_API dThreadingThreadPoolID dThreadingAllocateThreadPool(unsigned thread_count,
196  size_t stack_size, unsigned int ode_data_allocate_flags, void *reserved/*=NULL*/);
197 
218 ODE_API void dThreadingThreadPoolServeMultiThreadedImplementation(dThreadingThreadPoolID pool, dThreadingImplementationID impl);
219 
242 ODE_API void dThreadingThreadPoolWaitIdleState(dThreadingThreadPoolID pool);
243 
257 ODE_API void dThreadingFreeThreadPool(dThreadingThreadPoolID pool);
258 
259 
260 #ifdef __cplusplus
261 }
262 #endif
263 
264 #endif /* #ifndef _ODE_THREADING_IMPL_H_ */
An interface structure with function pointers to be provided by threading implementation.
Definition: threading.h:370