On Friday 07 February 2014 08:54:53 Patrick Shirkey wrote:
> It compiles fine for me on debian-7.0 64bit. However it crashes on start
> and I get this backtrace:

Does the attached patch fix it?

CU
Christian
Index: src/shell/TerminalCtrl.cpp
===================================================================
--- src/shell/TerminalCtrl.cpp	(revision 2516)
+++ src/shell/TerminalCtrl.cpp	(working copy)
@@ -15,20 +15,26 @@
 #include <assert.h>
 #include <sys/ioctl.h>
 #include <stdio.h>
+#include "../common/Mutex.h"
 
+using namespace LinuxSampler;
+
 ///////////////////////////////////////////////////////////////////////////
 // class 'TerminalSetting'
 
+static Mutex g_mutexReferences;
 static std::map<void*,int> g_terminalSettingReferences;
 
 static termios* _newTermios() {
     termios* p = new termios;
+    LockGuard lock(g_mutexReferences);
     g_terminalSettingReferences[p] = 1;
     return p;
 }
 
 static void _releaseTermiosRef(void* p) {
     if (!p) return;
+    LockGuard lock(g_mutexReferences);
     std::map<void*,int>::iterator it = g_terminalSettingReferences.find(p);
     assert(it != g_terminalSettingReferences.end());
     assert(it->second > 0);
@@ -41,6 +47,7 @@
 
 static termios* _bumpTermiosRef(void* p) {
     if (!p) return NULL;
+    LockGuard lock(g_mutexReferences);
     std::map<void*,int>::iterator it = g_terminalSettingReferences.find(p);
     assert(it != g_terminalSettingReferences.end());
     assert(it->second > 0);
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to