Changeset 25434

Show
Ignore:
Timestamp:
05/10/08 16:34:51 (6 days ago)
Author:
bonefish
Message:
Added timeout constant B_ABSOLUTE_REAL_TIME_TIMEOUT which specifies a
timeout relative to the Epoch.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/headers/os/kernel/OS.h

    r25003 r25434  
    2626 
    2727enum { 
    28         B_TIMEOUT                       = 8,    /* relative timeout */ 
    29         B_RELATIVE_TIMEOUT      = 8,    /* fails after a relative timeout with B_WOULD_BLOCK */ 
    30         B_ABSOLUTE_TIMEOUT      = 16    /* fails after an absolute timeout with B_WOULD BLOCK */ 
     28        B_TIMEOUT                                               = 0x8,  /* relative timeout */ 
     29        B_RELATIVE_TIMEOUT                              = 0x8,  /* fails after a relative timeout 
     30                                                                                                with B_TIMED_OUT */ 
     31        B_ABSOLUTE_TIMEOUT                              = 0x10, /* fails after an absolute timeout 
     32                                                                                                with B_TIMED_OUT */ 
     33 
     34        /* experimental Haiku only API */ 
     35        B_TIMEOUT_REAL_TIME_BASE                = 0x40, 
     36        B_ABSOLUTE_REAL_TIME_TIMEOUT    = B_ABSOLUTE_TIMEOUT 
     37                                                                                | B_TIMEOUT_REAL_TIME_BASE 
    3138}; 
    3239 
  • haiku/trunk/src/system/kernel/thread.cpp

    r25389 r25434  
    3131#include <kscheduler.h> 
    3232#include <ksignal.h> 
     33#include <real_time_clock.h> 
    3334#include <smp.h> 
    3435#include <syscalls.h> 
     
    22722273                // otherwise occur between our cancel_timer() and a concurrently 
    22732274                // executing thread_block_timeout(). 
    2274                 uint32 timerFlags = (timeoutFlags & B_RELATIVE_TIMEOUT) 
    2275                         ? B_ONE_SHOT_RELATIVE_TIMER : B_ONE_SHOT_ABSOLUTE_TIMER; 
     2275                uint32 timerFlags; 
     2276                if ((timeoutFlags & B_RELATIVE_TIMEOUT) != 0) { 
     2277                        timerFlags = B_ONE_SHOT_RELATIVE_TIMER; 
     2278                } else { 
     2279                        timerFlags = B_ONE_SHOT_ABSOLUTE_TIMER; 
     2280                        if ((timeoutFlags & B_TIMEOUT_REAL_TIME_BASE) != 0) 
     2281                                timeout -= rtc_boot_time(); 
     2282                } 
    22762283                timerFlags |= B_TIMER_ACQUIRE_THREAD_LOCK; 
    22772284