mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
				synced 2023-10-19 15:58:31 +00:00 
			
		
		
		
	Update Locking in extensions/globaltimers.c
This commit is contained in:
		@@ -52,11 +52,14 @@ void cGlobalTimers::MarkLocalTimers(void) {
 | 
				
			|||||||
        delete[] localTimer;
 | 
					        delete[] localTimer;
 | 
				
			||||||
        localTimer = NULL;
 | 
					        localTimer = NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    const cTimers* timers;
 | 
				
			||||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
 | 
					#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
    LOCK_TIMERS_READ;
 | 
					    LOCK_TIMERS_READ;
 | 
				
			||||||
    const cTimers* timers = Timers;
 | 
					    timers = Timers;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    const cTimers* timers = &Timers;
 | 
					    timers = &Timers;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    int numTimers = Size();
 | 
					    int numTimers = Size();
 | 
				
			||||||
    if (numTimers > 0) {
 | 
					    if (numTimers > 0) {
 | 
				
			||||||
@@ -78,14 +81,17 @@ void cGlobalTimers::MarkLocalTimers(void) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void cGlobalTimers::SetLocalTimers(void) {
 | 
					void cGlobalTimers::SetLocalTimers(void) {
 | 
				
			||||||
 | 
					    const cTimers* timers;
 | 
				
			||||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
 | 
					#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
    LOCK_TIMERS_READ;
 | 
					    LOCK_TIMERS_READ;
 | 
				
			||||||
    const cTimers* timers = Timers;
 | 
					    timers = Timers;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
    const cTimers* timers = &Timers;
 | 
					    timers = &Timers;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    for (const cTimer *Timer = timers->First(); Timer; Timer = timers->Next(Timer)) {
 | 
					    for (const cTimer *Timer = timers->First(); Timer; Timer = timers->Next(Timer)) {
 | 
				
			||||||
        if (Timer->HasFlags(tfActive))
 | 
					        if (Timer && Timer->HasFlags(tfActive))
 | 
				
			||||||
            Append(Timer);
 | 
					            Append(Timer);
 | 
				
			||||||
    }    
 | 
					    }    
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user