Ignore:
Timestamp:
Oct 4, 2018, 11:50:21 PM (6 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_condvar.c

    r508 r566  
    3232#include <remote_mutex.h>
    3333
    34 ////////////////////////////////////////
     34
     35#if DEBUG_SYS_CONDVAR
     36/////////////////////////////////////////////////////
     37static char * sys_convar_op_str( uint32_t operation )
     38{
     39        if     ( operation == CONDVAR_INIT      ) return "INIT";
     40        else if( operation == CONDVAR_WAIT      ) return "WAIT";
     41        else if( operation == CONDVAR_SIGNAL    ) return "SIGNAL";
     42        else if( operation == CONDVAR_BROADCAST ) return "BROADCAST";
     43        else if( operation == CONDVAR_DESTROY   ) return "DESTROY";
     44        else                                      return "undefined";
     45}
     46#endif
     47
     48//////////////////////////////////////
    3549int sys_condvar( void         * condvar,
    3650                 uint32_t       operation,
    3751                 void         * mutex )
    3852{
     53    vseg_t    * vseg;         // for condvar check
    3954        error_t     error;
    40     vseg_t    * vseg;
    4155 
    4256    thread_t  * this    = CURRENT_THREAD;
    4357    process_t * process = this->process;
     58
     59#if DEBUG_SYS_CONDVAR
     60uint64_t    tm_start;
     61uint64_t    tm_end;
     62tm_start = hal_get_cycles();
     63if( DEBUG_SYS_CONDVAR < tm_start )
     64printk("\n[DBG] %s : thread %x in process %x enter for %s / cycle %d\n",
     65__FUNCTION__, this->trdid, process->pid, sys_condvar_op_str( operation ), (uint32_t)tm_start );
     66#endif
    4467
    4568    // check condvar in user vspace
     
    191214        }   // end switch
    192215
     216    hal_fence();
     217
     218#if DEBUG_SYS_CONDVAR
     219tm_start = hal_get_cycles();
     220if( DEBUG_SYS_MUTEX < tm_start )
     221printk("\n[DBG] %s : thread %x in process %x exit for %s / cycle %d\n",
     222__FUNCTION__, this->trdid, process->pid, sys_condvar_op_str( operation ), (uint32_t)tm_start );
     223#endif
     224
    193225        return 0;
    194226
Note: See TracChangeset for help on using the changeset viewer.