3
* $Id: Thread.cc,v 1.1.1.1 2003/02/08 00:42:21 dairiki Exp $
5
* Copyright (C) 2003 Geoffrey T. Dairiki
7
* This file is part of Pyxine, Python bindings for xine.
9
* Pyxine is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License
11
* as published by the Free Software Foundation; either version 2
12
* of the License, or (at your option) any later version.
14
* Pyxine is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
#pragma implementation
28
ThreadRunner::c_thread_runner (void *data)
30
static_cast<pyxine::Thread *>(data)->run();
35
ThreadRunner::ThreadRunner (Thread * thread)
37
pthread_create(&t, NULL, c_thread_runner, thread);
41
ThreadRunner::~ThreadRunner ()
43
cerr << "Stopping Thread" << endl;
44
// FIXME: check for errors
46
pthread_join(t, NULL);
47
cerr << "Thread stopped" << endl;