Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (4 years ago)
Author:
alain
Message:

All modifications required to support the <tcp_chat> application
including error recovery in case of packet loss.A

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_sem.c

    r671 r683  
    22 * remote_sem.c - POSIX unnamed semaphore implementation.
    33 *
    4  * Author   Alain Greiner  (2016,2017,2018,2019)
     4 * Author   Alain Greiner  (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    8686                           uint32_t   value )
    8787{
    88     kmem_req_t     req;   
    8988    remote_sem_t * sem_ptr;
    9089
     
    10099
    101100    // allocate memory for new semaphore in reference cluster
    102     req.type  = KMEM_KCM;
    103     req.order = bits_log2( sizeof(remote_sem_t) );
    104     req.flags = AF_ZERO | AF_KERNEL;
    105     sem_ptr   = kmem_remote_alloc( ref_cxy, &req );
     101    sem_ptr = kmem_remote_alloc( ref_cxy , bits_log2(sizeof(remote_sem_t)) , AF_ZERO );
    106102
    107103    if( sem_ptr == NULL )
     
    144140void remote_sem_destroy( xptr_t sem_xp )
    145141{
    146     kmem_req_t  req;
    147 
    148142    // get pointer on local process descriptor
    149143    process_t * process = CURRENT_THREAD->process;
     
    176170
    177171    // release memory allocated for semaphore descriptor
    178     req.type = KMEM_KCM;
    179     req.ptr  = sem_ptr;
    180     kmem_remote_free( sem_cxy , &req );
     172    kmem_remote_free( sem_cxy , sem_ptr , bits_log2(sizeof(remote_sem_t)) );
    181173
    182174}  // end remote_sem_destroy()
Note: See TracChangeset for help on using the changeset viewer.