Changeset 81 for trunk/src


Ignore:
Timestamp:
Jul 10, 2009, 1:14:41 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

QThread: OS/2: move set priority stuff to a separate private function to avoid mutex recursion.

Location:
trunk/src/corelib/thread
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/corelib/thread/qthread_os2.cpp

    r74 r81  
    322322}
    323323
     324
     325
     326
     327
     328
     329
     330
     331
     332
     333
     334
     335
     336
     337
     338
     339
     340
     341
     342
     343
     344
     345
     346
     347
     348
     349
     350
     351
     352
     353
     354
     355
     356
     357
     358
     359
     360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
     373
     374
     375
     376
    324377void QThread::start(Priority priority)
    325378{
     
    344397    }
    345398
    346     setPriority(priority);
     399    setPriority(priority);
    347400}
    348401
     
    446499    }
    447500
    448     d->priority = priority;
    449 
    450     ULONG prioClass = 0;
    451     LONG prioDelta = 0;
    452     switch (priority) {
    453         case IdlePriority:
    454             prioClass = PRTYC_IDLETIME;
    455             prioDelta = PRTYD_MINIMUM;
    456         break;
    457 
    458         case LowestPriority:
    459             prioClass = PRTYC_IDLETIME;
    460             break;
    461 
    462         case LowPriority:
    463             prioClass = PRTYC_IDLETIME;
    464             prioDelta = PRTYD_MAXIMUM;
    465             break;
    466 
    467         case NormalPriority:
    468                 prioClass = PRTYC_REGULAR;
    469                 break;
    470 
    471         case HighPriority:
    472             prioClass = PRTYC_REGULAR;
    473             prioDelta = PRTYD_MAXIMUM;
    474             break;
    475 
    476         case HighestPriority:
    477                 prioClass = PRTYC_TIMECRITICAL;
    478                 break;
    479 
    480         case TimeCriticalPriority:
    481             prioClass = PRTYC_TIMECRITICAL;
    482             prioDelta = PRTYD_MAXIMUM;
    483             break;
    484 
    485         case InheritPriority:
    486         default:
    487             PTIB ptib;
    488             DosGetInfoBlocks( &ptib, NULL );
    489             prioClass = (ptib->tib_ptib2->tib2_ulpri >> 8) & 0xFF;
    490             prioDelta = (ptib->tib_ptib2->tib2_ulpri) & 0xFF;
    491             break;
    492     }
    493 
    494     APIRET rc = DosSetPriority(PRTYS_THREAD, prioClass, prioDelta, d->tid);
    495     if (rc != NO_ERROR)
    496         qWarning("QThread::setPriority: DosSetPriority returned %lu", rc);
     501    d->setPriority(priority);
    497502}
    498503
  • trunk/src/corelib/thread/qthread_p.h

    r69 r81  
    180180    bool terminationEnabled, terminatePending;
    181181
     182
     183
    182184    static void start(void *);
    183185    static void finish(void *, bool lockAnyway=true);
Note: See TracChangeset for help on using the changeset viewer.