Browse Source

Revert a few things regarding CarlaProcessUtils

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
ea18354705
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
6 changed files with 26 additions and 37 deletions
  1. +0
    -4
      source/backend/utils/System.cpp
  2. +0
    -1
      source/bridges-ui/CarlaBridgeFormat.cpp
  3. +1
    -1
      source/jackbridge/JackBridge2.cpp
  4. +0
    -1
      source/libjack/libjack.cpp
  5. +0
    -28
      source/utils/CarlaProcessUtils.cpp
  6. +25
    -2
      source/utils/CarlaProcessUtils.hpp

+ 0
- 4
source/backend/utils/System.cpp View File

@@ -39,7 +39,3 @@ void carla_set_process_name(const char* name)
}

// -------------------------------------------------------------------------------------------------------------------

#include "CarlaProcessUtils.cpp"

// -------------------------------------------------------------------------------------------------------------------

+ 0
- 1
source/bridges-ui/CarlaBridgeFormat.cpp View File

@@ -344,6 +344,5 @@ void CarlaBridgeFormat::exec(const bool showUI)
CARLA_BRIDGE_UI_END_NAMESPACE

#include "CarlaPipeUtils.cpp"
#include "CarlaProcessUtils.cpp"

// ---------------------------------------------------------------------

+ 1
- 1
source/jackbridge/JackBridge2.cpp View File

@@ -19,7 +19,7 @@
#ifdef JACKBRIDGE_DUMMY
# include "CarlaUtils.hpp"
#else
# include "CarlaProcessUtils.cpp"
# include "CarlaProcessUtils.hpp"
# include "CarlaSemUtils.hpp"
# include "CarlaShmUtils.hpp"
#endif // ! JACKBRIDGE_DUMMY


+ 0
- 1
source/libjack/libjack.cpp View File

@@ -1395,7 +1395,6 @@ pthread_t jack_client_thread_id(jack_client_t* client)

#include "jackbridge/JackBridge2.cpp"
#include "CarlaBridgeUtils.cpp"
#include "CarlaProcessUtils.cpp"

// ---------------------------------------------------------------------------------------------------------------------
// TODO


+ 0
- 28
source/utils/CarlaProcessUtils.cpp View File

@@ -17,34 +17,6 @@

#include "CarlaProcessUtils.hpp"

#ifdef CARLA_OS_LINUX
# include <sys/prctl.h>
#endif

// --------------------------------------------------------------------------------------------------------------------
// process functions

void carla_setProcessName(const char* const name) noexcept
{
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',);

#ifdef CARLA_OS_LINUX
::prctl(PR_SET_NAME, name, 0, 0, 0);
#endif
}

void carla_terminateProcessOnParentExit(const bool kill) noexcept
{
#ifdef CARLA_OS_LINUX
//
::prctl(PR_SET_PDEATHSIG, kill ? SIGKILL : SIGTERM);
// TODO, osx version too, see https://stackoverflow.com/questions/284325/how-to-make-child-process-die-after-parent-exits
#endif

// maybe unused
return; (void)kill;
}

// --------------------------------------------------------------------------------------------------------------------
// process utility classes



+ 25
- 2
source/utils/CarlaProcessUtils.hpp View File

@@ -25,18 +25,41 @@
# include <csetjmp>
#endif

#ifdef CARLA_OS_LINUX
# include <sys/prctl.h>
#endif

// --------------------------------------------------------------------------------------------------------------------
// process functions

/*
* Set current process name.
*/
void carla_setProcessName(const char* const name) noexcept;
static inline
void carla_setProcessName(const char* const name) noexcept
{
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',);

#ifdef CARLA_OS_LINUX
::prctl(PR_SET_NAME, name, 0, 0, 0);
#endif
}

/*
* Set flag to automatically terminate ourselves if parent process dies.
*/
void carla_terminateProcessOnParentExit(const bool kill) noexcept;
static inline
void carla_terminateProcessOnParentExit(const bool kill) noexcept
{
#ifdef CARLA_OS_LINUX
//
::prctl(PR_SET_PDEATHSIG, kill ? SIGKILL : SIGTERM);
// TODO, osx version too, see https://stackoverflow.com/questions/284325/how-to-make-child-process-die-after-parent-exits
#endif

// maybe unused
return; (void)kill;
}

// --------------------------------------------------------------------------------------------------------------------
// process utility classes


Loading…
Cancel
Save