Add another subsystem between nested tasks
This commit is contained in:
		
							parent
							
								
									e22e6a21e0
								
							
						
					
					
						commit
						28517c2000
					
				| @ -33,5 +33,8 @@ INSTR_1ARG(instr_nosv_task_pause, "VTp", int32_t, id) | ||||
| INSTR_1ARG(instr_nosv_task_resume, "VTr", int32_t, id) | ||||
| INSTR_1ARG(instr_nosv_task_end, "VTe", int32_t, id) | ||||
| 
 | ||||
| INSTR_0ARG(instr_nosv_submit_enter, "VAs") | ||||
| INSTR_0ARG(instr_nosv_submit_exit,  "VAS") | ||||
| 
 | ||||
| 
 | ||||
| #endif /* INSTR_NOSV_H */ | ||||
|  | ||||
| @ -14,6 +14,8 @@ main(void) | ||||
| 	uint32_t taskid = 1; | ||||
| 	instr_nosv_task_create(taskid, typeid); | ||||
| 	instr_nosv_task_execute(taskid); | ||||
| 	/* Change subsystem to prevent duplicates */ | ||||
| 	instr_nosv_submit_enter(); | ||||
| 	/* Run another nested task with same id (should fail) */ | ||||
| 	instr_nosv_task_execute(taskid); | ||||
| 
 | ||||
|  | ||||
| @ -7,6 +7,8 @@ static void | ||||
| create_and_run(int32_t id, uint32_t typeid, int us) | ||||
| { | ||||
| 	instr_nosv_task_create(id, typeid); | ||||
| 	/* Change subsystem to prevent duplicates */ | ||||
| 	instr_nosv_submit_enter(); | ||||
| 	instr_nosv_task_execute(id); | ||||
| 	usleep(us); | ||||
| } | ||||
| @ -26,8 +28,11 @@ main(void) | ||||
| 		create_and_run(i + 1, typeid, 500); | ||||
| 
 | ||||
| 	/* End the tasks in the opposite order */ | ||||
| 	for (int i = ntasks - 1; i >= 0; i--) | ||||
| 	for (int i = ntasks - 1; i >= 0; i--) { | ||||
| 		instr_nosv_task_end(i + 1); | ||||
| 		/* Change subsystem to prevent duplicates */ | ||||
| 		instr_nosv_submit_exit(); | ||||
| 	} | ||||
| 
 | ||||
| 	instr_end(); | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user