blob: bdde51614245bbc76ba271defc839aaf25ae3df8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
template<class obj_type>
tupel<obj_type>::tupel()
{
pthread_mutex_init( &mut_tupel, NULL );
}
template<class obj_type>
tupel<obj_type>::tupel(obj_type t_obj)
{
this->t_obj = t_obj;
pthread_mutex_init( &mut_tupel, NULL );
}
template<class obj_type>
tupel<obj_type>::~tupel()
{
pthread_mutex_destroy( &mut_tupel );
}
template<class obj_type>
obj_type
tupel<obj_type>::get_elem()
{
pthread_mutex_lock( &mut_tupel );
obj_type t_ret = t_obj;
pthread_mutex_unlock( &mut_tupel );
return t_ret;
}
template<class obj_type>
void
tupel<obj_type>::set_elem(obj_type t_obj)
{
pthread_mutex_lock( &mut_tupel );
this->t_obj = t_obj;
pthread_mutex_unlock( &mut_tupel );
}
|