diff options
| author | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:17:31 +0200 |
|---|---|---|
| committer | admin (centauri.fritz.box) <puppet@mx.buetow.org> | 2014-07-01 20:17:31 +0200 |
| commit | e5ff213596011443c467a5257ed6fe5847265d7f (patch) | |
| tree | b7322e71dd7f2fb1ff6824cb20acc706b84d06c5 /src/chat/sman.cpp | |
| parent | 0b4ccf59b27f0a8de71b10120b50c916fdbc46a0 (diff) | |
| parent | 13aaf70af703748fe096e0664c305cd202637ad2 (diff) | |
Mergeychat-0.8
Diffstat (limited to 'src/chat/sman.cpp')
| -rw-r--r-- | src/chat/sman.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/chat/sman.cpp b/src/chat/sman.cpp index 661085f..53a15f7 100644 --- a/src/chat/sman.cpp +++ b/src/chat/sman.cpp @@ -1,7 +1,7 @@ /*:* *: File: ./src/chat/sman.cpp *: - *: yChat; Homepage: www.yChat.org; Version 0.7.9.5-RELEASE + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow @@ -32,7 +32,7 @@ sman::sman() { - i_session_count = 0; + i_continous_session_count = i_session_count = 0; pthread_mutex_init( &mut_i_session_count, NULL ); } @@ -85,10 +85,9 @@ sess *sman::create_session( ) pthread_mutex_lock( &mut_i_session_count ); i_session_count++; -#ifdef NCURSES - - print_sessions(); -#endif + wrap::system_message(string(SESSIOC) + "(" + + tool::int2string(++i_continous_session_count) + "," + + tool::int2string(reinterpret_cast<int>(p_sess)) + ")" ); pthread_mutex_unlock( &mut_i_session_count ); @@ -106,12 +105,15 @@ sess *sman::get_session( string s_id ) void sman::destroy_session( string s_id ) { + sess* p_sess = get_elem(s_id); + pthread_mutex_lock( &mut_i_session_count ); i_session_count--; #ifdef NCURSES - print_sessions(); -#endif + wrap::system_message(string(SESSIOD) + "(" + + tool::int2string(i_continous_session_count) + "," + + tool::int2string(reinterpret_cast<int>(p_sess)) + ")" ); pthread_mutex_unlock( &mut_i_session_count ); @@ -142,12 +144,18 @@ void sman::print_init_ncurses() int sman::get_session_count() { - int i_ret; pthread_mutex_lock( &mut_i_session_count ); - i_ret = i_session_count; + int i_ret = i_session_count; pthread_mutex_unlock( &mut_i_session_count ); return i_ret; } -#endif +/* +void +sman::dump() { + shashmap<sess*>::dump(); + cout << "BLA" << endl; +} +*/ + #endif |
