Changeset 472 for trunk/kernel/kern
- Timestamp:
- Aug 21, 2018, 5:58:40 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/process.c
r469 r472 1040 1040 trdid_t * trdid ) 1041 1041 { 1042 ltid_t ltid; 1043 bool_t found = false; 1042 ltid_t ltid; 1043 thread_type_t type; 1044 reg_t save_sr; 1045 bool_t found = false; 1046 1044 1047 1045 1048 assert( (process != NULL) , __FUNCTION__ , "process argument is NULL" ); … … 1047 1050 assert( (thread != NULL) , __FUNCTION__ , "thread argument is NULL" ); 1048 1051 1049 // take lock protecting th_tbl 1050 spinlock_lock( &process->th_lock ); 1052 // take lock protecting th_tbl, depending on thread type: 1053 // 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 ); 1051 1056 1052 1057 // search a free slot in th_tbl[] … … 1072 1077 // release lock protecting th_tbl 1073 1078 hal_fence(); 1074 spinlock_unlock( &process->th_lock ); 1079 if( type == THREAD_IDLE ) spinlock_unlock_busy( &process->th_lock , save_sr ); 1080 else spinlock_unlock( &process->th_lock ); 1075 1081 1076 1082 return (found) ? 0 : ENOMEM;
Note: See TracChangeset
for help on using the changeset viewer.