Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2328

Show
Ignore:
Timestamp:
06/19/07 12:10:39 (1 year ago)
Author:
sean
Message:

Fix for linux (and darwin, I assume) not defining pthread_setschedprio.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/common/tango/core/Thread.d

    r2298 r2328  
    712712        else version( Posix ) 
    713713        { 
    714             if( pthread_setschedprio( m_addr, val ) ) 
     714            // NOTE: pthread_setschedprio is not implemented on linux, so use 
     715            //       the more complicated get/set sequence below. 
     716            //if( pthread_setschedprio( m_addr, val ) ) 
     717            //    throw new ThreadException( "Unable to set thread priority" ); 
     718 
     719            int         policy; 
     720            sched_param param; 
     721 
     722            if( pthread_getschedparam( m_addr, &policy, &param ) ) 
     723                throw new ThreadException( "Unable to set thread priority" ); 
     724            param.sched_priority = val; 
     725            if( pthread_setschedparam( m_addr, policy, &param ) ) 
    715726                throw new ThreadException( "Unable to set thread priority" ); 
    716727        } 
  • trunk/tango/stdc/posix/pthread.d

    r2305 r2328  
    442442    int pthread_getschedparam(pthread_t, int*, sched_param*); 
    443443    int pthread_setschedparam(pthread_t, int, sched_param*); 
    444     int pthread_setschedprio(pthread_t, int); 
     444    //int pthread_setschedprio(pthread_t, int); 
    445445} 
    446446else version( darwin ) 
     
    460460    int pthread_getschedparam(pthread_t, int*, sched_param*); 
    461461    int pthread_setschedparam(pthread_t, int, sched_param*); 
    462     int pthread_setschedprio(pthread_t, int); 
     462    //int pthread_setschedprio(pthread_t, int); 
    463463} 
    464464