/[svn]/linuxsampler/trunk/src/network/lscpserver.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/network/lscpserver.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3765 by schoenebeck, Fri Dec 16 12:57:59 2016 UTC revision 3766 by schoenebeck, Mon Apr 6 12:41:49 2020 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 - 2016 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2020 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This library is free software; you can redistribute it and/or modify  *   *   This library is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 380  int LSCPServer::WaitUntilInitialized(lon Line 380  int LSCPServer::WaitUntilInitialized(lon
380  }  }
381    
382  int LSCPServer::Main() {  int LSCPServer::Main() {
383        #if DEBUG
384        Thread::setNameOfCaller("LSCPServer");
385        #endif
386    
387          #if defined(WIN32)          #if defined(WIN32)
388          WSADATA wsaData;          WSADATA wsaData;
389          int iResult;          int iResult;
# Line 446  int LSCPServer::Main() { Line 450  int LSCPServer::Main() {
450      timeval timeout;      timeval timeout;
451    
452      while (true) {      while (true) {
453          #if CONFIG_PTHREAD_TESTCANCEL  
454                  TestCancel();                  TestCancel();
455          #endif  
456            // prevent thread from being cancelled
457            // (e.g. to prevent deadlocks while holding mutex lock(s))
458            pushCancelable(false);
459    
460          // check if some engine channel's parameter / status changed, if so notify the respective LSCP event subscribers          // check if some engine channel's parameter / status changed, if so notify the respective LSCP event subscribers
461          {          {
462              LockGuard lock(EngineChannelFactory::EngineChannelsMutex);              LockGuard lock(EngineChannelFactory::EngineChannelsMutex);
# Line 533  int LSCPServer::Main() { Line 541  int LSCPServer::Main() {
541              bufferedNotifies.clear();              bufferedNotifies.clear();
542          }          }
543    
544            // now allow thread being cancelled again
545            // (since all mutexes are now unlocked)
546            popCancelable();
547    
548          fd_set selectSet = fdSet;          fd_set selectSet = fdSet;
549          timeout.tv_sec  = 0;          timeout.tv_sec  = 0;
550          timeout.tv_usec = 100000;          timeout.tv_usec = 100000;

Legend:
Removed from v.3765  
changed lines
  Added in v.3766

  ViewVC Help
Powered by ViewVC