Skip to content
Snippets Groups Projects
Select Git revision
  • 812b7b0725ba8035d25394aa0b7a4daa8c36fce9
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/windowsReleaseTest
  • release/releaseTest
  • release/releaseWindowsTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 4.0.0
  • 2.2.0
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
31 results

threadloop.h

Blame
    • Hugo Lefeuvre's avatar
      f5257847
      threadloop: remove EXIT_IF_FAIL macro · f5257847
      Hugo Lefeuvre authored
      
      EXIT_IF_FAIL was meant to replace
      
      if (!(A)) {
          RING_ERR(__VA_ARGS__);
          loop_.exit();
      }
      
      but it is not very readable. Also, loop_.exit() throws an exception
      where setup functions calling EXIT_IF_FAIL could simply return
      false. Throwing an exception has a higher overhead and leads to less
      readable debug output (+ throwing exceptions should never be the
      standard way to exit the normal control flow).
      
      This patch
      - removes the EXIT_IF_FAIL macro
      - replaces code from audio_rtp_session and video_receive_thread which
        was using this macro
      - Adds stop() call at the end of ThreadLoop::mainloop. At this point
        the thread loop is obviously not executing anymore.
      
      Change-Id: Id1ed8eb914e91686a63775eba3ad70f8b6143ae5
      Reviewed-by: default avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
      f5257847
      History
      threadloop: remove EXIT_IF_FAIL macro
      Hugo Lefeuvre authored
      
      EXIT_IF_FAIL was meant to replace
      
      if (!(A)) {
          RING_ERR(__VA_ARGS__);
          loop_.exit();
      }
      
      but it is not very readable. Also, loop_.exit() throws an exception
      where setup functions calling EXIT_IF_FAIL could simply return
      false. Throwing an exception has a higher overhead and leads to less
      readable debug output (+ throwing exceptions should never be the
      standard way to exit the normal control flow).
      
      This patch
      - removes the EXIT_IF_FAIL macro
      - replaces code from audio_rtp_session and video_receive_thread which
        was using this macro
      - Adds stop() call at the end of ThreadLoop::mainloop. At this point
        the thread loop is obviously not executing anymore.
      
      Change-Id: Id1ed8eb914e91686a63775eba3ad70f8b6143ae5
      Reviewed-by: default avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    dhtnode.cpp 10.94 KiB