Ignore:
Timestamp:
Jan 13, 2021, 12:36:17 AM (9 months 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_mutex.c

    r635 r683  
    22 * remote_mutex.c - POSIX mutex implementation.
    33 *
    4  * Authors   Alain   Greiner (2016,2017,2018,2019)
     4 * Authors   Alain   Greiner (2016,2017,2018,2019,2020:)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    8585{
    8686    remote_mutex_t * mutex_ptr;
    87     kmem_req_t       req;   
    8887
    8988    // get pointer on local process descriptor
     
    9897
    9998    // allocate memory for mutex descriptor in reference cluster
    100     req.type    = KMEM_KCM;
    101     req.order   = bits_log2( sizeof(remote_mutex_t) );
    102     req.flags   = AF_ZERO | AF_KERNEL;
    103     mutex_ptr   = kmem_remote_alloc( ref_cxy , &req );
     99    mutex_ptr = kmem_remote_alloc( ref_cxy , bits_log2(sizeof(remote_mutex_t)) , AF_ZERO );
    104100
    105101    if( mutex_ptr == NULL )
     
    145141void remote_mutex_destroy( xptr_t mutex_xp )
    146142{
    147     kmem_req_t  req;
    148 
    149143    // get pointer on local process descriptor
    150144    process_t * process = CURRENT_THREAD->process;
     
    171165
    172166    // release memory allocated for mutex descriptor
    173     req.type = KMEM_KCM;
    174     req.ptr  = mutex_ptr;
    175     kmem_remote_free( mutex_cxy , &req );
     167    kmem_remote_free( mutex_cxy , mutex_ptr , bits_log2(sizeof(remote_mutex_t)) );
    176168
    177169}  // end remote_mutex_destroy()
Note: See TracChangeset for help on using the changeset viewer.