Browse Source

Use of set_threaded_log_function only when needed in RT threads.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2450 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
b44e22de0e
8 changed files with 18 additions and 11 deletions
  1. +4
    -0
      ChangeLog
  2. +3
    -0
      common/JackClient.cpp
  3. +1
    -3
      common/JackError.cpp
  4. +0
    -2
      common/JackPosixThread.cpp
  5. +4
    -1
      common/JackThreadedDriver.cpp
  6. +3
    -0
      linux/alsa/alsa_rawmidi.c
  7. +2
    -2
      macosx/JackMachThread.cpp
  8. +1
    -3
      windows/JackWinThread.cpp

+ 4
- 0
ChangeLog View File

@@ -20,6 +20,10 @@ Fernando Lopez-Lezcano
Jackdmp changes log Jackdmp changes log
--------------------------- ---------------------------


2008-06-04 Stephane Letz <letz@grame.fr>

* Use of set_threaded_log_function only when needed in RT threads.

2008-06-02 Stephane Letz <letz@grame.fr> 2008-06-02 Stephane Letz <letz@grame.fr>


* Tim Blechmann patch to remove unnecessary virtual methods : choice of the appropriate platform version is now done at compilation time. * Tim Blechmann patch to remove unnecessary virtual methods : choice of the appropriate platform version is now done at compilation time.


+ 3
- 0
common/JackClient.cpp View File

@@ -340,6 +340,9 @@ bool JackClient::Execute()
{ {
if (!jack_tls_set(gRealTime, this)) if (!jack_tls_set(gRealTime, this))
jack_error("failed to set thread realtime key"); jack_error("failed to set thread realtime key");
if (GetEngineControl()->fRealTime)
set_threaded_log_function();
if (fThreadFun) { if (fThreadFun) {
// Execute a dummy cycle to be sure thread has the correct properties (ensure thread creation is finished) // Execute a dummy cycle to be sure thread has the correct properties (ensure thread creation is finished)


+ 1
- 3
common/JackError.cpp View File

@@ -63,9 +63,7 @@ void jack_log_function(int level, const char *message)
log_callback(message); log_callback(message);
} }


static
void
jack_format_and_log(int level, const char *prefix, const char *fmt, va_list ap)
static void jack_format_and_log(int level, const char *prefix, const char *fmt, va_list ap)
{ {
char buffer[300]; char buffer[300];
size_t len; size_t len;


+ 0
- 2
common/JackPosixThread.cpp View File

@@ -40,8 +40,6 @@ void* JackPosixThread::ThreadHandler(void* arg)
jack_error("pthread_setcanceltype err = %s", strerror(err)); jack_error("pthread_setcanceltype err = %s", strerror(err));
} }
set_threaded_log_function();
// Signal creation thread when started with StartSync // Signal creation thread when started with StartSync
jack_log("ThreadHandler: start"); jack_log("ThreadHandler: start");
obj->fStatus = kIniting; obj->fStatus = kIniting;


+ 4
- 1
common/JackThreadedDriver.cpp View File

@@ -108,8 +108,11 @@ bool JackThreadedDriver::Init()
jack_log("JackThreadedDriver::Init IsRealTime"); jack_log("JackThreadedDriver::Init IsRealTime");
// Will do "something" on OSX only... // Will do "something" on OSX only...
fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint); fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint);
if (fThread.AcquireRealTime(GetEngineControl()->fPriority) < 0)
if (fThread.AcquireRealTime(GetEngineControl()->fPriority) < 0) {
jack_error("AcquireRealTime error"); jack_error("AcquireRealTime error");
} else {
set_threaded_log_function();
}
} }
return true; return true;
} else { } else {


+ 3
- 0
linux/alsa/alsa_rawmidi.c View File

@@ -837,6 +837,9 @@ void *midi_thread(void *arg)
pfds[0].events = POLLIN|POLLERR|POLLNVAL; pfds[0].events = POLLIN|POLLERR|POLLNVAL;
npfds = 1; npfds = 1;


if (jack_is_realtime(midi->client))
set_threaded_log_function();

//debug_log("midi_thread(%s): enter", str->name); //debug_log("midi_thread(%s): enter", str->name);


while (midi->keep_walking) { while (midi->keep_walking) {


+ 2
- 2
macosx/JackMachThread.cpp View File

@@ -39,7 +39,7 @@ int JackMachThread::SetThreadToPriority(pthread_t thread, UInt32 inPriority, Boo
theTCPolicy.constraint = AudioConvertNanosToHostTime(constraint); theTCPolicy.constraint = AudioConvertNanosToHostTime(constraint);
theTCPolicy.preemptible = true; theTCPolicy.preemptible = true;
kern_return_t res = thread_policy_set(pthread_mach_thread_np(thread), THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t) & theTCPolicy, THREAD_TIME_CONSTRAINT_POLICY_COUNT); kern_return_t res = thread_policy_set(pthread_mach_thread_np(thread), THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t) & theTCPolicy, THREAD_TIME_CONSTRAINT_POLICY_COUNT);
jack_log("JackMachThread::thread_policy_set %ld", res);
jack_log("JackMachThread::thread_policy_set res = %ld", res);
return (res == KERN_SUCCESS) ? 0 : -1; return (res == KERN_SUCCESS) ? 0 : -1;
} else { } else {
// OTHER THREADS // OTHER THREADS
@@ -62,7 +62,7 @@ int JackMachThread::SetThreadToPriority(pthread_t thread, UInt32 inPriority, Boo


thePrecedencePolicy.importance = relativePriority; thePrecedencePolicy.importance = relativePriority;
kern_return_t res = thread_policy_set(pthread_mach_thread_np(thread), THREAD_PRECEDENCE_POLICY, (thread_policy_t) & thePrecedencePolicy, THREAD_PRECEDENCE_POLICY_COUNT); kern_return_t res = thread_policy_set(pthread_mach_thread_np(thread), THREAD_PRECEDENCE_POLICY, (thread_policy_t) & thePrecedencePolicy, THREAD_PRECEDENCE_POLICY_COUNT);
jack_log("JackMachThread::thread_policy_set %ld", res);
jack_log("JackMachThread::thread_policy_set res = %ld", res);
return (res == KERN_SUCCESS) ? 0 : -1; return (res == KERN_SUCCESS) ? 0 : -1;
} }
} }


+ 1
- 3
windows/JackWinThread.cpp View File

@@ -34,9 +34,7 @@ DWORD WINAPI JackWinThread::ThreadHandler(void* arg)
{ {
JackWinThread* obj = (JackWinThread*)arg; JackWinThread* obj = (JackWinThread*)arg;
JackRunnableInterface* runnable = obj->fRunnable; JackRunnableInterface* runnable = obj->fRunnable;

set_threaded_log_function();
// Signal creation thread when started with StartSync // Signal creation thread when started with StartSync
jack_log("ThreadHandler: start"); jack_log("ThreadHandler: start");
obj->fStatus = kIniting; obj->fStatus = kIniting;


Loading…
Cancel
Save