summaryrefslogtreecommitdiff
path: root/src/name.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/name.cpp')
-rw-r--r--src/name.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/name.cpp b/src/name.cpp
index 9c91ec7..77c6f9a 100644
--- a/src/name.cpp
+++ b/src/name.cpp
@@ -1,12 +1,11 @@
/*:*
*: File: ./src/name.cpp
*:
- *: 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
@@ -32,21 +31,28 @@
using namespace std;
name::name()
-{}
+{
+ pthread_mutex_init( &mut_s_name, NULL);
+}
name::name( string s_name )
{
+ pthread_mutex_init( &mut_s_name, NULL);
set_name( s_name );
}
name::~name()
-{}
+{
+ pthread_mutex_destroy( &mut_s_name );
+}
string
name::get_name()
{
string s_ret;
+ pthread_mutex_lock ( &mut_s_name );
s_ret = s_name;
+ pthread_mutex_unlock( &mut_s_name );
return s_ret;
}
@@ -59,7 +65,9 @@ name::get_lowercase_name()
void
name::set_name( string s_name )
{
+ pthread_mutex_lock ( &mut_s_name );
this->s_name = s_name;
+ pthread_mutex_unlock( &mut_s_name );
}
#endif