~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to tothread.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2006-06-30 19:49:57 UTC
  • mfrom: (1.2.3 upstream) (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20060630194957-cyt5gcqgl9095z2i
Tags: 1.3.21-3ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
#ifdef QT_THREAD_SUPPORT
50
50
 
51
 
#ifdef WIN32
52
 
bool toWaitCondition::wait(QMutex *mutex, unsigned long time)
53
 
{
54
 
    bool status = FALSE;
55
 
 
56
 
    // this implementation relies on existing wait() method
57
 
    if (mutex)
58
 
    {
59
 
        mutex->unlock();
60
 
        status = QWaitCondition::wait(time);
61
 
        mutex->lock ()
62
 
        ;
63
 
    }
64
 
    else
65
 
        status = QWaitCondition::wait(time);
66
 
 
67
 
    return status;
68
 
}
69
 
#endif
70
51
 
71
52
void toSemaphore::up(void)
72
53
{
304
285
toLock *toThread::Lock;
305
286
int toThread::LastID = 0;
306
287
__declspec( thread ) int toThread::ThreadID = 0;
307
 
int toThread::MainThread = 0;
 
288
int toThread::MainThread = -1;
308
289
 
309
290
bool toThread::mainThread(void)
310
291
{
360
341
        StartSemaphore.up();
361
342
        toThread::LastID++;
362
343
        toThread::ThreadID = LastID;
 
344
        if (toThread::MainThread==-1)
 
345
          toThread::MainThread=LastID;
363
346
        Lock->unlock();
364
347
        Task->run();
365
348
        Lock->lock ()