Panda3D
Loading...
Searching...
No Matches
genericThread.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file genericThread.I
10 * @author drose
11 * @date 2011-11-09
12 */
13
14/**
15 * Replaces the function that is called when the thread runs.
16 */
17INLINE void GenericThread::
18set_function(GenericThread::ThreadFunc *function) {
19 _function = function;
20}
21
22/**
23 * Returns the function that is called when the thread runs.
24 */
25INLINE GenericThread::ThreadFunc *GenericThread::
26get_function() const {
27 return _function;
28}
29
30/**
31 * Replaces the void pointer that is passed to the thread function. This is
32 * any arbitrary pointer; the thread object does no processing on it.
33 */
34INLINE void GenericThread::
35set_user_data(void *user_data) {
36 _user_data = user_data;
37}
38
39/**
40 * Returns the void pointer that is passed to the thread function.
41 */
42INLINE void *GenericThread::
43get_user_data() const {
44 return _user_data;
45}
ThreadFunc * get_function() const
Returns the function that is called when the thread runs.
void set_user_data(void *user_data)
Replaces the void pointer that is passed to the thread function.
void * get_user_data() const
Returns the void pointer that is passed to the thread function.
void set_function(ThreadFunc *function)
Replaces the function that is called when the thread runs.