Changeset 436 for trunk/kernel/syscalls/sys_thread_sleep.c
- Timestamp:
- Mar 7, 2018, 9:02:03 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_thread_sleep.c
r408 r436 30 30 int sys_thread_sleep() 31 31 { 32 32 33 thread_t * this = CURRENT_THREAD; 33 34 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 36 uint64_t tm_start; 37 uint64_t tm_end; 38 tm_start = hal_get_cycles(); 39 if( CONFIG_DEBUG_SYS_THREAD_SLEEP < tm_start ) 40 printk("\n[DBG] %s : thread %x blocked / process %x / cycle %d\n", 41 __FUNCTION__ , this, this->process->pid , (uint32_t)tm_start ); 42 #endif 36 43 37 thread_block( this, THREAD_BLOCKED_GLOBAL );44 thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_GLOBAL ); 38 45 sched_yield("blocked on sleep"); 39 46 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 48 tm_end = hal_get_cycles(); 49 if( CONFIG_DEBUG_SYS_THREAD_SLEEP < tm_end ) 50 printk("\n[DBG] %s : thread %x resume / process %x / cycle %d\n", 51 __FUNCTION__ , this, this->process->pid , (uint32_t)tm_end ); 52 #endif 42 53 43 54 return 0; 55 44 56 } // end sys_thread_sleep()
Note: See TracChangeset
for help on using the changeset viewer.