Panda3D
 All Classes Functions Variables Enumerations
genericThread.I
1 // Filename: genericThread.I
2 // Created by: drose (09Nov11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: GenericThread::set_function
18 // Access: Published
19 // Description: Replaces the function that is called when the thread
20 // runs.
21 ////////////////////////////////////////////////////////////////////
22 INLINE void GenericThread::
23 set_function(GenericThread::ThreadFunc *function) {
24  _function = function;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: GenericThread::get_function
29 // Access: Published
30 // Description: Returns the function that is called when the thread
31 // runs.
32 ////////////////////////////////////////////////////////////////////
33 INLINE GenericThread::ThreadFunc *GenericThread::
34 get_function() const {
35  return _function;
36 }
37 
38 ////////////////////////////////////////////////////////////////////
39 // Function: GenericThread::set_user_data
40 // Access: Published
41 // Description: Replaces the void pointer that is passed to the thread
42 // function. This is any arbitrary pointer; the thread
43 // object does no processing on it.
44 ////////////////////////////////////////////////////////////////////
45 INLINE void GenericThread::
46 set_user_data(void *user_data) {
47  _user_data = user_data;
48 }
49 
50 ////////////////////////////////////////////////////////////////////
51 // Function: GenericThread::get_user_data
52 // Access: Published
53 // Description: Returns the void pointer that is passed to the thread
54 // function.
55 ////////////////////////////////////////////////////////////////////
56 INLINE void *GenericThread::
57 get_user_data() const {
58  return _user_data;
59 }
ThreadFunc * get_function() const
Returns the function that is called when the thread runs.
Definition: genericThread.I:34
void set_function(ThreadFunc *function)
Replaces the function that is called when the thread runs.
Definition: genericThread.I:23
void set_user_data(void *user_data)
Replaces the void pointer that is passed to the thread function.
Definition: genericThread.I:46
void * get_user_data() const
Returns the void pointer that is passed to the thread function.
Definition: genericThread.I:57