summaryrefslogtreecommitdiff
path: root/src/memb
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2010-11-21 16:20:55 +0000
committerPaul Buetow <paul@buetow.org>2010-11-21 16:20:55 +0000
commit6fde6b0fe90abde84011202edd40fe46eb06af44 (patch)
treeef760338c50b4df3ae9cca96347bca962fdbec7e /src/memb
parent55b08bd93257d32df76efc4e8e3f49311c39ee82 (diff)
Diffstat (limited to 'src/memb')
-rw-r--r--src/memb/memb.h3
-rw-r--r--src/memb/memb.tmpl3
-rw-r--r--src/memb/tupel.h4
-rw-r--r--src/memb/tupel.tmpl16
4 files changed, 16 insertions, 10 deletions
diff --git a/src/memb/memb.h b/src/memb/memb.h
index 3a0d8f6..1997750 100644
--- a/src/memb/memb.h
+++ b/src/memb/memb.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/memb/memb.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
diff --git a/src/memb/memb.tmpl b/src/memb/memb.tmpl
index 6ab0219..37eb2ab 100644
--- a/src/memb/memb.tmpl
+++ b/src/memb/memb.tmpl
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/memb/memb.tmpl
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
diff --git a/src/memb/tupel.h b/src/memb/tupel.h
index e453a12..f4cc288 100644
--- a/src/memb/tupel.h
+++ b/src/memb/tupel.h
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/memb/tupel.h
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -36,6 +35,7 @@ template<class obj_type>
class tupel
{
private:
+ pthread_mutex_t mut_tupel;
obj_type t_obj;
public:
diff --git a/src/memb/tupel.tmpl b/src/memb/tupel.tmpl
index d2b5535..acc8c40 100644
--- a/src/memb/tupel.tmpl
+++ b/src/memb/tupel.tmpl
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/memb/tupel.tmpl
*:
- *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT
+ *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT
*:
*: Copyright (C) 2003 Paul C. Buetow, Volker Richter
*: Copyright (C) 2004 Paul C. Buetow
*: Copyright (C) 2005 EXA Digital Solutions GbR
- *: Copyright (C) 2006, 2007 Paul C. Buetow
*:
*: This program is free software; you can redistribute it and/or
*: modify it under the terms of the GNU General Public License
@@ -25,23 +24,30 @@
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;
}
@@ -49,5 +55,7 @@ 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);
}