Ignore:
Timestamp:
Mar 7, 2018, 9:02:03 AM (4 years ago)
Author:
alain
Message:

1) improve the threads and process destruction mechanism.
2) introduce FIFOs in the soclib_tty driver.

File:
1 edited

Legend:

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

    r408 r436  
    3030int sys_thread_sleep()
    3131{
     32
    3233    thread_t * this = CURRENT_THREAD;
    3334
    34     thread_dmsg("\n[DBG] %s : thread %x in process %x goes to sleep at cycle %d\n",
    35                 __FUNCTION__, this->trdid, this->process->pid, hal_get_cycles() );
     35#if CONFIG_DEBUG_SYS_THREAD_SLEEP
     36uint64_t     tm_start;
     37uint64_t     tm_end;
     38tm_start = hal_get_cycles();
     39if( CONFIG_DEBUG_SYS_THREAD_SLEEP < tm_start )
     40printk("\n[DBG] %s : thread %x blocked / process %x / cycle %d\n",
     41__FUNCTION__ , this, this->process->pid , (uint32_t)tm_start );
     42#endif
    3643
    37     thread_block( this , THREAD_BLOCKED_GLOBAL );
     44    thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_GLOBAL );
    3845    sched_yield("blocked on sleep");
    3946
    40     thread_dmsg("\n[DBG] %s : thread %x in process %x resume at cycle\n",
    41                 __FUNCTION__, this->trdid, this->process->pid, hal_get_cycles() );
     47#if CONFIG_DEBUG_SYS_THREAD_SLEEP
     48tm_end = hal_get_cycles();
     49if( CONFIG_DEBUG_SYS_THREAD_SLEEP < tm_end )
     50printk("\n[DBG] %s : thread %x resume / process %x / cycle %d\n",
     51__FUNCTION__ , this, this->process->pid , (uint32_t)tm_end );
     52#endif
    4253
    4354        return 0;
     55
    4456}  // end sys_thread_sleep()
Note: See TracChangeset for help on using the changeset viewer.