mirror of
				https://github.com/ossrs/srs.git
				synced 2025-03-09 15:49:59 +00:00 
			
		
		
		
	Refine conneciton manager
This commit is contained in:
		
							parent
							
								
									4eae93d27b
								
							
						
					
					
						commit
						33f1cb87a2
					
				
					 1 changed files with 7 additions and 3 deletions
				
			
		|  | @ -39,6 +39,9 @@ SrsConnectionManager::SrsConnectionManager() | |||
| 
 | ||||
| SrsConnectionManager::~SrsConnectionManager() | ||||
| { | ||||
|     srs_cond_signal(cond); | ||||
|     trd->stop(); | ||||
| 
 | ||||
|     srs_freep(trd); | ||||
|     srs_cond_destroy(cond); | ||||
| 
 | ||||
|  | @ -50,7 +53,7 @@ srs_error_t SrsConnectionManager::start() | |||
|     srs_error_t err = srs_success; | ||||
| 
 | ||||
|     if ((err = trd->start()) != srs_success) { | ||||
|         return srs_error_wrap(err, "coroutine manager"); | ||||
|         return srs_error_wrap(err, "conn manager"); | ||||
|     } | ||||
| 
 | ||||
|     return err; | ||||
|  | @ -62,11 +65,12 @@ srs_error_t SrsConnectionManager::cycle() | |||
| 
 | ||||
|     while (true) { | ||||
|         if ((err = trd->pull()) != srs_success) { | ||||
|             return srs_error_wrap(err, "coroutine mansger"); | ||||
|             return srs_error_wrap(err, "conn manager"); | ||||
|         } | ||||
| 
 | ||||
|         srs_cond_wait(cond); | ||||
|         clear(); | ||||
| 
 | ||||
|         srs_cond_wait(cond); | ||||
|     } | ||||
| 
 | ||||
|     return err; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue