- Timestamp:
- Aug 26, 2018, 7:24:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.c
r503 r514 1041 1041 { 1042 1042 ltid_t ltid; 1043 thread_type_t type;1044 1043 reg_t save_sr; 1045 1044 bool_t found = false; … … 1052 1051 // take lock protecting th_tbl, depending on thread type: 1053 1052 // we don't want to use a descheduling policy for idle thread initialisation 1054 if( type == THREAD_IDLE ) spinlock_lock_busy( &process->th_lock , &save_sr ); 1055 else spinlock_lock( &process->th_lock ); 1053 if ( thread->type == THREAD_IDLE ) { 1054 spinlock_lock_busy( &process->th_lock , &save_sr ); 1055 } else { 1056 spinlock_lock( &process->th_lock ); 1057 } 1056 1058 1057 1059 // search a free slot in th_tbl[] … … 1077 1079 // release lock protecting th_tbl 1078 1080 hal_fence(); 1079 if( type == THREAD_IDLE ) spinlock_unlock_busy( &process->th_lock , save_sr ); 1080 else spinlock_unlock( &process->th_lock ); 1081 if( thread->type == THREAD_IDLE ) { 1082 spinlock_unlock_busy( &process->th_lock , save_sr ); 1083 } else { 1084 spinlock_unlock( &process->th_lock ); 1085 } 1081 1086 1082 1087 return (found) ? 0 : ENOMEM;
Note: See TracChangeset
for help on using the changeset viewer.