author | simon <simon> | 2002-12-11 10:58:16 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 10:58:16 (UTC) |
commit | 616e7437498c7adcad77d9b79e9c450a75b260ca (patch) (unidiff) | |
tree | b5a5291eabfc779b671a7436a377cc4a455b95bf | |
parent | 6ee0a61001307e71f51d1e8c7beaa81a94df89aa (diff) | |
download | opie-616e7437498c7adcad77d9b79e9c450a75b260ca.zip opie-616e7437498c7adcad77d9b79e9c450a75b260ca.tar.gz opie-616e7437498c7adcad77d9b79e9c450a75b260ca.tar.bz2 |
- make it compile for gcc2: step1
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.h | 5 |
2 files changed, 9 insertions, 10 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index a5cc92d..7a9e1a4 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp | |||
@@ -138,22 +138,22 @@ struct Thread::Data | |||
138 | extern "C" | 138 | extern "C" |
139 | { | 139 | { |
140 | 140 | ||
141 | void _threadutil_terminate_thread( void *arg ) | 141 | static void terminate_thread( void *arg ) |
142 | { | 142 | { |
143 | Thread *thr = ( Thread* )arg; | 143 | Thread::Data *data = ( Thread::Data* )arg; |
144 | 144 | ||
145 | assert( thr ); | 145 | assert( data ); |
146 | 146 | ||
147 | AutoLock locker( thr->d->guard ); | 147 | AutoLock locker( data->guard ); |
148 | thr->d->isRunning = false; | 148 | data->isRunning = false; |
149 | thr->d->finishCondition.wakeAll(); | 149 | data->finishCondition.wakeAll(); |
150 | } | 150 | } |
151 | 151 | ||
152 | void *_threadutil_start_thread( void *arg ) | 152 | void *_threadutil_start_thread( void *arg ) |
153 | { | 153 | { |
154 | Thread *thr = ( Thread* )arg; | 154 | Thread *thr = ( Thread* )arg; |
155 | 155 | ||
156 | pthread_cleanup_push( _threadutil_terminate_thread, thr ); | 156 | pthread_cleanup_push( terminate_thread, thr->d ); |
157 | 157 | ||
158 | thr->d->isRunning = true; | 158 | thr->d->isRunning = true; |
159 | thr->run(); | 159 | thr->run(); |
diff --git a/noncore/multimedia/opieplayer2/threadutil.h b/noncore/multimedia/opieplayer2/threadutil.h index b67b61d..21ae6b2 100644 --- a/noncore/multimedia/opieplayer2/threadutil.h +++ b/noncore/multimedia/opieplayer2/threadutil.h | |||
@@ -29,7 +29,6 @@ class QSocketNotifier; | |||
29 | extern "C" | 29 | extern "C" |
30 | { | 30 | { |
31 | void *_threadutil_start_thread( void* ); | 31 | void *_threadutil_start_thread( void* ); |
32 | void _threadutil_terminate_thread( void* ); | ||
33 | } | 32 | } |
34 | 33 | ||
35 | namespace ThreadUtil | 34 | namespace ThreadUtil |
@@ -90,8 +89,9 @@ namespace ThreadUtil | |||
90 | class Thread | 89 | class Thread |
91 | { | 90 | { |
92 | friend void *::_threadutil_start_thread( void* ); | 91 | friend void *::_threadutil_start_thread( void* ); |
93 | friend void ::_threadutil_terminate_thread( void* ); | ||
94 | public: | 92 | public: |
93 | struct Data; | ||
94 | |||
95 | Thread(); | 95 | Thread(); |
96 | virtual ~Thread(); | 96 | virtual ~Thread(); |
97 | 97 | ||
@@ -107,7 +107,6 @@ namespace ThreadUtil | |||
107 | virtual void run() = 0; | 107 | virtual void run() = 0; |
108 | 108 | ||
109 | private: | 109 | private: |
110 | struct Data; | ||
111 | Data *d; | 110 | Data *d; |
112 | }; | 111 | }; |
113 | 112 | ||