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_condvar.c

    r635 r683  
    22 * remote_condvar.c - remote kernel condition variable 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
     
    8686{
    8787    remote_condvar_t * condvar_ptr;
    88     kmem_req_t         req;   
    8988
    9089    // get pointer on local process descriptor
     
    9897    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
    9998
    100     req.type    = KMEM_KCM;
    101     req.order   = bits_log2( sizeof(remote_condvar_t) );
    102     req.flags   = AF_ZERO | AF_KERNEL;
    103     condvar_ptr = kmem_alloc( &req );
     99    // allocate memory for condvar descriptor
     100    condvar_ptr = kmem_alloc( bits_log2(sizeof(remote_condvar_t)) , AF_ZERO );
    104101
    105102    if( condvar_ptr == NULL )
     
    130127void remote_condvar_destroy( xptr_t condvar_xp )
    131128{
    132     kmem_req_t  req;
    133 
    134129    // get pointer on local process descriptor
    135130    process_t * process = CURRENT_THREAD->process;
     
    162157
    163158    // release memory allocated for condvar descriptor
    164     req.type = KMEM_KCM;
    165     req.ptr  = condvar_ptr;
    166     kmem_remote_free( ref_cxy , &req );
     159    kmem_remote_free( ref_cxy , condvar_ptr , bits_log2(sizeof(remote_condvar_t)) );
    167160
    168161}  // end remote_convar_destroy()
Note: See TracChangeset for help on using the changeset viewer.