Changeset 22392

Show
Ignore:
Timestamp:
09/30/07 21:41:46 (14 months ago)
Author:
bonefish
Message:

Moved the select_sync_pool from tty_cookie to tty. No need to have one
per cookie.

Location:
haiku/trunk/src/add-ons/kernel/drivers/tty
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • haiku/trunk/src/add-ons/kernel/drivers/tty/tty.cpp

    r22379 r22392  
    784784        tty->lock = NULL; 
    785785        tty->settings = &gTTYSettings[index]; 
     786        tty->select_pool = NULL; 
    786787        tty->is_master = isMaster; 
    787788        tty->pending_eof = 0; 
     
    917918        cookie->other_tty = otherTTY; 
    918919        cookie->open_mode = openMode; 
    919         cookie->select_pool = NULL; 
    920920        cookie->thread_count = 0; 
    921921        cookie->closed = false; 
     
    10521052        } 
    10531053 
    1054         // notify all pending selects and clean up the pool 
    1055         if (cookie->select_pool) { 
    1056                 notify_select_event_pool(cookie->select_pool, B_SELECT_READ); 
    1057                 notify_select_event_pool(cookie->select_pool, B_SELECT_WRITE); 
    1058                 notify_select_event_pool(cookie->select_pool, B_SELECT_ERROR); 
    1059  
    1060                 delete_select_sync_pool(cookie->select_pool); 
    1061                 cookie->select_pool = NULL; 
    1062         } 
    1063  
    10641054        // notify a select write event on the other tty, if we've closed this tty 
    10651055        if (cookie->tty->open_count == 0 && cookie->other_tty->open_count > 0) 
     
    10731063        TRACE(("tty_notify_select_event(%p, %u)\n", tty, event)); 
    10741064 
    1075         for (TTYCookieList::Iterator it = tty->cookies.GetIterator(); 
    1076                  it.HasNext();) { 
    1077                 tty_cookie *cookie = it.Next(); 
    1078  
    1079                 if (cookie->select_pool) 
    1080                         notify_select_event_pool(cookie->select_pool, event); 
    1081         } 
     1065        if (tty->select_pool) 
     1066                notify_select_event_pool(tty->select_pool, event); 
    10821067} 
    10831068 
     
    17061691 
    17071692        // add the event to the TTY's pool 
    1708         status_t error = add_select_sync_pool_entry(&cookie->select_pool, sync, ref, 
     1693        status_t error = add_select_sync_pool_entry(&tty->select_pool, sync, ref, 
    17091694                event); 
    17101695        if (error != B_OK) { 
     
    17851770        MutexLocker ttyLocker(tty->lock); 
    17861771 
    1787         return remove_select_sync_pool_entry(&cookie->select_pool, sync, event); 
    1788 } 
    1789  
     1772        return remove_select_sync_pool_entry(&tty->select_pool, sync, event); 
     1773} 
     1774 
  • haiku/trunk/src/add-ons/kernel/drivers/tty/tty_private.h

    r22357 r22392  
    111111        struct tty                      *other_tty; 
    112112        uint32                          open_mode; 
    113         select_sync_pool        *select_pool; 
    114113        int32                           thread_count; 
    115114        sem_id                          blocking_semaphore; 
     
    131130        struct mutex*           lock; 
    132131        tty_settings*           settings; 
     132        select_sync_pool*       select_pool; 
    133133        RequestQueue            reader_queue; 
    134134        RequestQueue            writer_queue;