From e0592745a40dae2e14e5b6d9226f41a293ababc9 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 16 Jun 2005 21:28:57 +0000 Subject: Rewrote thread object Fixed bug in mov_encoder (pushed read_sem too many times, whihc lead to growing server queue) --- src/camera.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/camera.cc') diff --git a/src/camera.cc b/src/camera.cc index 52fe0b8..a9a0982 100644 --- a/src/camera.cc +++ b/src/camera.cc @@ -31,6 +31,11 @@ /* * $Log$ + * Revision 1.18 2005/06/16 21:28:57 deva + * Rewrote thread object + * Fixed bug in mov_encoder (pushed read_sem too many times, whihc lead to + * growing server queue) + * * Revision 1.17 2005/05/25 13:11:42 deva * * Made unfreeze close connection, when no recording is done. @@ -133,21 +138,24 @@ void Camera::connect(const char *ip, const int port) } */ - pthread_create (&decodetid, NULL, thread_run, decoder); + // pthread_create (&decodetid, NULL, thread_run, decoder); + decoder->run(); /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (decoder thread)."); return; } */ - pthread_create (&encodetid, NULL, thread_run, encoder); + // pthread_create (&encodetid, NULL, thread_run, encoder); + encoder->run(); /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (encoder thread)."); return; } */ - pthread_create (&playertid, NULL, thread_run, player); + // pthread_create (&playertid, NULL, thread_run, player); + player->run(); /* if(errorstatus->hasError()) { errorstatus->pushError("Camera initialization failed (player thread)."); @@ -162,9 +170,11 @@ Camera::~Camera() // Signal to the threads to stop running = 0; + /* // FIXME: Add some way to stop a thread object pthread_join(decodetid, NULL); pthread_join(playertid, NULL); pthread_join(encodetid, NULL); + */ delete decoder; delete encoder; -- cgit v1.2.3