summaryrefslogtreecommitdiff
path: root/src/thrd
diff options
context:
space:
mode:
Diffstat (limited to 'src/thrd')
-rw-r--r--src/thrd/CVS/Entries8
-rwxr-xr-xsrc/thrd/pool.cpp9
-rwxr-xr-xsrc/thrd/pool.h9
-rw-r--r--src/thrd/thro.cpp1
-rw-r--r--src/thrd/thro.h2
5 files changed, 13 insertions, 16 deletions
diff --git a/src/thrd/CVS/Entries b/src/thrd/CVS/Entries
index 00f4a55..f9507bd 100644
--- a/src/thrd/CVS/Entries
+++ b/src/thrd/CVS/Entries
@@ -1,5 +1,5 @@
-/pool.cpp/1.12/Sun Feb 13 03:53:35 2005//
-/pool.h/1.9/Sun Feb 13 00:49:29 2005//
-/thro.cpp/1.5/Fri Jan 7 21:00:19 2005//
-/thro.h/1.4/Fri Jan 7 21:00:19 2005//
+/pool.cpp/1.17/Fri Feb 25 01:22:35 2005//
+/pool.h/1.11/Fri Feb 25 00:15:38 2005//
+/thro.cpp/1.6/Mon Feb 21 01:55:50 2005//
+/thro.h/1.5/Mon Feb 21 01:55:50 2005//
D
diff --git a/src/thrd/pool.cpp b/src/thrd/pool.cpp
index dd29d6a..1f4ace6 100755
--- a/src/thrd/pool.cpp
+++ b/src/thrd/pool.cpp
@@ -14,7 +14,7 @@ pool::pool()
i_num_total_threads = 0;
i_num_avail_threads = tool::string2int( wrap::CONF->get_elem( "httpd.thread.initpoolsize" ) );
- increase_pool(i_num_avail_threads);
+ increase_pool(i_num_avail_threads);
}
pool::~pool()
@@ -91,10 +91,10 @@ pool::wait_for_task( void* p_void )
}
pthread_mutex_unlock(&p_pool->mut_num_avail_threads);
- pthread_mutex_lock(&p_pool->mut_queue_tasks);
+ pthread_mutex_lock(&p_pool->mut_queue_tasks);
task* p_task = p_pool->queue_tasks.front();
p_pool->queue_tasks.pop();
- pthread_mutex_unlock(&p_pool->mut_queue_tasks);
+ pthread_mutex_unlock(&p_pool->mut_queue_tasks);
pthread_mutex_unlock(&p_pool->mut_threads);
@@ -118,8 +118,9 @@ pool::run(void* p_void)
void
pool::run_func(void *p_void)
{
- socketcontainer* p_sock = static_cast<socketcontainer*>(p_void);
+ int* p_sock = static_cast<int*>(p_void);
wrap::SOCK->read_write(p_sock);
+ delete p_sock;
}
bool
diff --git a/src/thrd/pool.h b/src/thrd/pool.h
index 3a5f7b6..78c4163 100755
--- a/src/thrd/pool.h
+++ b/src/thrd/pool.h
@@ -7,11 +7,9 @@
using namespace std;
-class pool
+class pool
{
private:
- friend class thro;
-
struct task
{
void(*p_func)(void*);
@@ -22,7 +20,7 @@ private:
this->p_func = p_func;
this->p_void = p_void;
}
- };
+ };
pthread_mutex_t mut_threads;
pthread_mutex_t mut_queue_tasks;
@@ -43,11 +41,10 @@ public:
pool();
~pool();
- void run(void* p_void);
+ void run(void* p_void);
bool allow_user_login();
#ifdef NCURSES
-
void print_pool_size();
#endif
};
diff --git a/src/thrd/thro.cpp b/src/thrd/thro.cpp
index 8b3f1ba..e35520c 100644
--- a/src/thrd/thro.cpp
+++ b/src/thrd/thro.cpp
@@ -23,7 +23,6 @@ thro::run( void *p_void )
{
elem.p_thro = this;
elem.p_void = p_void;
- //wrap::POOL->add_task(start_, &elem);
pthread_create( &pthread, NULL, start_, &elem );
}
diff --git a/src/thrd/thro.h b/src/thrd/thro.h
index 8e7e0cf..783cd0d 100644
--- a/src/thrd/thro.h
+++ b/src/thrd/thro.h
@@ -17,7 +17,7 @@ private:
}
elem;
- static void *start_( void *p_void );
+ static void* start_( void *p_void );
public:
thro( );