mirror of
				https://github.com/pion/webrtc.git
				synced 2025-10-31 02:36:46 +08:00 
			
		
		
		
	 3f2c36d153
			
		
	
	3f2c36d153
	
	
	
		
			
			Start properly setting the PeerConnectionState and make OnConnectionState available Resolves #614
		
			
				
	
	
		
			21 lines
		
	
	
		
			264 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			264 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package webrtc
 | |
| 
 | |
| import "sync/atomic"
 | |
| 
 | |
| type atomicBool struct {
 | |
| 	val int32
 | |
| }
 | |
| 
 | |
| func (b *atomicBool) set(value bool) {
 | |
| 	var i int32
 | |
| 	if value {
 | |
| 		i = 1
 | |
| 	}
 | |
| 
 | |
| 	atomic.StoreInt32(&(b.val), i)
 | |
| }
 | |
| 
 | |
| func (b *atomicBool) get() bool {
 | |
| 	return atomic.LoadInt32(&(b.val)) != 0
 | |
| }
 |