Changeset 5f925685 in rtems


Ignore:
Timestamp:
Nov 1, 2010, 5:32:53 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 5, master
Children:
a14b982
Parents:
d84ff53
Message:

2010-11-01 Alin Rus <alin.codejunkie@…>

  • posix/include/rtems/posix/aio_misc.h, posix/src/aio_misc.c: Small fixes.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rd84ff53 r5f925685  
     12010-11-01      Alin Rus <alin.codejunkie@gmail.com>
     2
     3        * posix/include/rtems/posix/aio_misc.h, posix/src/aio_misc.c: Small
     4        fixes.
     5
    162010-10-21      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • cpukit/posix/include/rtems/posix/aio_misc.h

    rd84ff53 r5f925685  
    3030  typedef struct
    3131  {
     32    rtems_chain_node next_prio; /* chain requests in order of priority */
    3233    int policy;                 /* If _POSIX_PRIORITIZED_IO and
    3334                                   _POSIX_PRIORITY_SCHEDULING are defined */
    3435    int priority;               /* see above */
    35     rtems_chain_node next_prio; /* chain requests in order of priority */
    3636    pthread_t caller_thread;    /* used for notification */
    3737    struct aiocb *aiocbp;       /* aio control block */
     
    4040  typedef struct
    4141  {
    42     int fildes;                 /* file descriptor to be processed */ 
    43     int new_fd;                 /* if this is a newly created chain */
    4442    rtems_chain_node next_fd;   /* order fd chains in queue */
    4543    rtems_chain_control perfd;  /* chain of requests for this fd */
     44    int fildes;                 /* file descriptor to be processed */
     45    int new_fd;                 /* if this is a newly created chain */
    4646    pthread_mutex_t mutex;     
    4747    pthread_cond_t cond;
  • cpukit/posix/src/aio_misc.c

    rd84ff53 r5f925685  
    9595  rtems_chain_node *node;
    9696
    97   node = chain->first;
     97  node = rtems_chain_first (chain);
    9898  r_chain = (rtems_aio_request_chain *) node;
    9999
    100100  while (r_chain->fildes < fildes && !rtems_chain_is_tail (chain, node)) {
    101     node = node->next;
     101    node = rtems_chain_next (node);
    102102    r_chain = (rtems_aio_request_chain *) node;
    103103  }
     
    115115        rtems_chain_prepend (chain, &r_chain->next_fd);
    116116      else
    117         rtems_chain_insert (node->previous, &r_chain->next_fd);
     117        rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd);
    118118
    119119      r_chain->new_fd = 1;
     120          r_chain->fildes = fildes;
    120121    }
    121122  }
     
    143144
    144145  AIO_printf ("FD exists \n");
    145   node = chain->first;
     146  node = rtems_chain_first (chain);
    146147
    147148  if (rtems_chain_is_empty (chain)) {
     
    154155    while (req->aiocbp->aio_reqprio > prio &&
    155156           !rtems_chain_is_tail (chain, node)) {
    156       node = node->next;
     157      node = rtems_chain_next (node);
    157158      prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
    158159    }
     
    181182
    182183  chain = &r_chain->perfd;
    183   node = chain->first;
     184  node = rtems_chain_first (chain);
    184185 
    185186  while (!rtems_chain_is_tail (chain, node))
     
    211212int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
    212213{
    213   rtems_chain_node *node = chain->first;
     214  rtems_chain_node *node = rtems_chain_first (chain);
    214215  rtems_aio_request *current;
    215216 
     
    217218
    218219  while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
    219     node = node->next;
     220    node = rtems_chain_next (node);
    220221    current = (rtems_aio_request *) node;
    221222  }
     
    258259
    259260  /* The queue should be initialized */
    260   AIO_assert (aio_request_queue.initialized != AIO_QUEUE_INITIALIZED);
     261  AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
    261262
    262263  result = pthread_mutex_lock (&aio_request_queue.mutex);
     
    289290        pthread_cond_init (&r_chain->cond, NULL);
    290291       
    291         AIO_printf ("New thread");
     292        AIO_printf ("New thread \n");
    292293        result = pthread_create (&thid, &aio_request_queue.attr,
    293294                                 rtems_aio_handle, (void *) r_chain);
     
    329330          /* If this is a new fd chain we signal the idle threads that
    330331             might be waiting for requests */
     332          AIO_printf (" New chain on waiting queue \n ");
    331333          rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
    332334          r_chain->new_fd = 0;
     
    334336          pthread_cond_init (&r_chain->cond, NULL);
    335337          pthread_cond_signal (&aio_request_queue.new_req);
     338          ++aio_request_queue.idle_threads;
    336339        } else
    337340          /* just insert the request in the existing fd chain */
     
    388391    if (!rtems_chain_is_empty (chain)) {
    389392
    390       node = chain->first;
     393      node = rtems_chain_first (chain);
    391394      req = (rtems_aio_request *) node;
    392395     
     
    482485                 start the loop all over again */
    483486              --aio_request_queue.idle_threads;
    484               node = aio_request_queue.idle_req.first;
     487              node = rtems_chain_first (&aio_request_queue.idle_req);
    485488              rtems_chain_extract (node);
    486489              r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
Note: See TracChangeset for help on using the changeset viewer.