From 6fde6b0fe90abde84011202edd40fe46eb06af44 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 21 Nov 2010 16:20:55 +0000 Subject: --- src/memb/tupel.tmpl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/memb/tupel.tmpl') 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 tupel::tupel() -{} +{ + pthread_mutex_init(&mut_tupel, NULL); +} template tupel::tupel(obj_type t_obj) { this->t_obj = t_obj; + pthread_mutex_init(&mut_tupel, NULL); } template tupel::~tupel() -{} +{ + pthread_mutex_destroy(&mut_tupel); +} template obj_type tupel::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 void tupel::set_elem(obj_type t_obj) { + pthread_mutex_lock(&mut_tupel); this->t_obj = t_obj; + pthread_mutex_unlock(&mut_tupel); } -- cgit v1.2.3