diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-08-15 09:37:54 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-08-15 09:37:54 +0200 |
commit | fc4bed511d1ab6faedffedd34846198b5955c5fd (patch) | |
tree | 8ece0dcfba70cf68535d5c7d555da6931bf7e450 /osd.c | |
parent | c13d6e6070d895dd33f82e80b5d045cbb417bc6c (diff) | |
download | vdr-fc4bed511d1ab6faedffedd34846198b5955c5fd.tar.gz vdr-fc4bed511d1ab6faedffedd34846198b5955c5fd.tar.bz2 |
Added a mutex to protect cOsd::Osds from simultaneous access from different threads
Diffstat (limited to 'osd.c')
-rw-r--r-- | osd.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: osd.c 2.22 2011/05/22 15:18:59 kls Exp $ + * $Id: osd.c 2.23 2011/08/15 09:27:39 kls Exp $ */ #include "osd.h" @@ -1600,9 +1600,11 @@ int cOsd::osdTop = 0; int cOsd::osdWidth = 0; int cOsd::osdHeight = 0; cVector<cOsd *> cOsd::Osds; +cMutex cOsd::mutex; cOsd::cOsd(int Left, int Top, uint Level) { + cMutexLock MutexLock(&mutex); isTrueColor = false; savedBitmap = NULL; numBitmaps = 0; @@ -1624,6 +1626,7 @@ cOsd::cOsd(int Left, int Top, uint Level) cOsd::~cOsd() { + cMutexLock MutexLock(&mutex); for (int i = 0; i < numBitmaps; i++) delete bitmaps[i]; delete savedBitmap; @@ -1944,6 +1947,7 @@ cOsdProvider::~cOsdProvider() cOsd *cOsdProvider::NewOsd(int Left, int Top, uint Level) { + cMutexLock MutexLock(&cOsd::mutex); if (Level == OSD_LEVEL_DEFAULT && cOsd::IsOpen()) esyslog("ERROR: attempt to open OSD while it is already open - using dummy OSD!"); else if (osdProvider) { |