* Adjusted thread priorities of several system services based on a mail from

Mikhail Panasyuk: since worker threads often end up with B_NORMAL_PRIORITY,
  it might be a good idea to give system threads a higher priority.
* Minor cleanup (mostly automatic whitespace).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33961 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-11-09 15:25:48 +00:00
parent 66570f5d3b
commit a0439d88df
8 changed files with 208 additions and 203 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008, Haiku, Inc. All Rights Reserved. * Copyright 2002-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -164,6 +164,9 @@ InputServer::InputServer()
CALLED(); CALLED();
gInputServer = this; gInputServer = this;
set_thread_priority(find_thread(NULL), B_URGENT_DISPLAY_PRIORITY);
// elevate priority for client interaction
_StartEventLoop(); _StartEventLoop();
char parameter[32]; char parameter[32];
@@ -654,7 +654,7 @@ AuthenticationManager::Init()
return fRequestPort; return fRequestPort;
fRequestThread = spawn_thread(&_RequestThreadEntry, fRequestThread = spawn_thread(&_RequestThreadEntry,
"authentication manager", B_NORMAL_PRIORITY, this); "authentication manager", B_NORMAL_PRIORITY + 1, this);
if (fRequestThread < 0) if (fRequestThread < 0)
return fRequestThread; return fRequestThread;
+36 -54
View File
@@ -1,42 +1,25 @@
//------------------------------------------------------------------------------ /*
// Copyright (c) 2001-2002, OpenBeOS * Copyright 2001-2009, Haiku Inc.
// * Distributed under the terms of the MIT License.
// Permission is hereby granted, free of charge, to any person obtaining a *
// copy of this software and associated documentation files (the "Software"), * Authors:
// to deal in the Software without restriction, including without limitation * Ingo Weinhold (bonefish@users.sf.net)
// the rights to use, copy, modify, merge, publish, distribute, sublicense, */
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
// #include "EventQueue.h"
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// File Name: EventQueue.cpp
// Author: Ingo Weinhold ([email protected])
// YellowBites (http://www.yellowbites.com)
// Description: A class providing a mechanism for executing events at
// specified times.
//------------------------------------------------------------------------------
#include <stdio.h> #include <stdio.h>
#include <String.h> #include <String.h>
#include "Event.h" #include "Event.h"
#include "EventQueue.h"
static const char *kDefaultEventQueueName = "event looper"; static const char *kDefaultEventQueueName = "event looper";
/*!
\class EventQueue /*! \class EventQueue
\brief A class providing a mechanism for executing events at specified \brief A class providing a mechanism for executing events at specified
times. times.
@@ -88,7 +71,6 @@ static const char *kDefaultEventQueueName = "event looper";
*/ */
// constructor
/*! \brief Creates a new event queue. /*! \brief Creates a new event queue.
The status of the initialization can and should be check with InitCheck(). The status of the initialization can and should be check with InitCheck().
@@ -97,12 +79,13 @@ static const char *kDefaultEventQueueName = "event looper";
a default name is used. a default name is used.
*/ */
EventQueue::EventQueue(const char *name) EventQueue::EventQueue(const char *name)
: fEvents(100), :
fEventLooper(-1), fEvents(100),
fLooperControl(-1), fEventLooper(-1),
fNextEventTime(0), fLooperControl(-1),
fStatus(B_ERROR), fNextEventTime(0),
fTerminating(false) fStatus(B_ERROR),
fTerminating(false)
{ {
if (!name) if (!name)
name = kDefaultEventQueueName; name = kDefaultEventQueueName;
@@ -112,8 +95,8 @@ EventQueue::EventQueue(const char *name)
else else
fStatus = fLooperControl; fStatus = fLooperControl;
if (fStatus == B_OK) { if (fStatus == B_OK) {
fEventLooper = spawn_thread(_EventLooperEntry, name, B_NORMAL_PRIORITY, fEventLooper = spawn_thread(_EventLooperEntry, name,
this); B_DISPLAY_PRIORITY + 1, this);
if (fEventLooper >= B_OK) { if (fEventLooper >= B_OK) {
fStatus = B_OK; fStatus = B_OK;
resume_thread(fEventLooper); resume_thread(fEventLooper);
@@ -122,7 +105,7 @@ EventQueue::EventQueue(const char *name)
} }
} }
// destructor
/*! \brief Frees all resources associated by this object. /*! \brief Frees all resources associated by this object.
Die() is called to terminate the queue's thread and all events whose Die() is called to terminate the queue's thread and all events whose
@@ -137,7 +120,7 @@ EventQueue::~EventQueue()
} }
} }
// InitCheck
/*! \brief Returns the initialization status of the event queue. /*! \brief Returns the initialization status of the event queue.
\return \c B_OK, if everything went fine, an error code otherwise. \return \c B_OK, if everything went fine, an error code otherwise.
*/ */
@@ -147,7 +130,7 @@ EventQueue::InitCheck()
return fStatus; return fStatus;
} }
// Die
/*! \brief Terminates the queue's thread. /*! \brief Terminates the queue's thread.
If an event is currently executed, it is allowed to finish its task If an event is currently executed, it is allowed to finish its task
@@ -165,7 +148,7 @@ EventQueue::Die()
} }
} }
// AddEvent
/*! \brief Adds a new event to the queue. /*! \brief Adds a new event to the queue.
The event's time must be set, before adding it. Afterwards ModifyEvent() The event's time must be set, before adding it. Afterwards ModifyEvent()
@@ -188,7 +171,7 @@ EventQueue::AddEvent(Event *event)
return result; return result;
} }
// RemoveEvent
/*! \brief Removes an event from the queue. /*! \brief Removes an event from the queue.
\param event The event to be removed. \param event The event to be removed.
\return \c true, if the event has been removed successfully, \c false, if \return \c true, if the event has been removed successfully, \c false, if
@@ -205,7 +188,7 @@ EventQueue::RemoveEvent(Event *event)
return result; return result;
} }
// ModifyEvent
/*! \brief Modifies an event's time. /*! \brief Modifies an event's time.
The event must be in the queue. The event must be in the queue.
@@ -228,7 +211,7 @@ EventQueue::ModifyEvent(Event *event, bigtime_t newTime)
Unlock(); Unlock();
} }
// _AddEvent
/*! \brief Adds an event to the event list. /*! \brief Adds an event to the event list.
\note The object must be locked when this method is invoked. \note The object must be locked when this method is invoked.
@@ -244,7 +227,7 @@ EventQueue::_AddEvent(Event *event)
return fEvents.AddItem(event, index); return fEvents.AddItem(event, index);
} }
// _RemoveEvent
/*! \brief Removes an event from the event list. /*! \brief Removes an event from the event list.
\note The object must be locked when this method is invoked. \note The object must be locked when this method is invoked.
@@ -260,7 +243,7 @@ EventQueue::_RemoveEvent(Event *event)
return (index >= 0 && fEvents.RemoveItem(index)); return (index >= 0 && fEvents.RemoveItem(index));
} }
// _EventAt
/*! \brief Returns an event from the event list. /*! \brief Returns an event from the event list.
\note The object must be locked when this method is invoked. \note The object must be locked when this method is invoked.
@@ -274,7 +257,7 @@ EventQueue::_EventAt(int32 index) const
return (Event*)fEvents.ItemAt(index); return (Event*)fEvents.ItemAt(index);
} }
// _IndexOfEvent
/*! \brief Returns the event list index of the supplied event. /*! \brief Returns the event list index of the supplied event.
\note The object must be locked when this method is invoked. \note The object must be locked when this method is invoked.
@@ -299,7 +282,7 @@ EventQueue::_IndexOfEvent(Event *event) const
return -1; return -1;
} }
// _FindInsertionIndex
/*! \brief Finds the event list index at which an event with the supplied /*! \brief Finds the event list index at which an event with the supplied
has to be added. has to be added.
@@ -330,7 +313,7 @@ EventQueue::_FindInsertionIndex(bigtime_t time) const
return lower; return lower;
} }
// _EventLooperEntry
/*! \brief Entry point from the queue's thread. /*! \brief Entry point from the queue's thread.
\param data The queue's \c this pointer. \param data The queue's \c this pointer.
\return The thread's result. Of no relevance in this case. \return The thread's result. Of no relevance in this case.
@@ -341,7 +324,7 @@ EventQueue::_EventLooperEntry(void *data)
return ((EventQueue*)data)->_EventLooper(); return ((EventQueue*)data)->_EventLooper();
} }
// _EventLooper
/*! \brief Method with the main loop of the queue's thread. /*! \brief Method with the main loop of the queue's thread.
\return The thread's result. Of no relevance in this case. \return The thread's result. Of no relevance in this case.
*/ */
@@ -385,7 +368,7 @@ EventQueue::_EventLooper()
return 0; return 0;
} }
// _Reschedule
/*! \brief To be called, when an event has been added or removed. /*! \brief To be called, when an event has been added or removed.
Checks whether the queue's thread has to recalculate the time when it Checks whether the queue's thread has to recalculate the time when it
@@ -402,4 +385,3 @@ EventQueue::_Reschedule()
release_sem(fLooperControl); release_sem(fLooperControl);
} }
} }
+63 -46
View File
@@ -1,4 +1,12 @@
// MIMEManager.cpp /*
* Copyright 2002-2009, Haiku Inc.
* Distributed under the terms of the MIT License.
*
* Authors:
* Ingo Weinhold (bonefish@users.sf.net)
* Tyler Dauwalder
*/
#include "MIMEManager.h" #include "MIMEManager.h"
@@ -19,23 +27,25 @@
#include "TextSnifferAddon.h" #include "TextSnifferAddon.h"
#include "UpdateMimeInfoThread.h" #include "UpdateMimeInfoThread.h"
using namespace std; using namespace std;
using namespace BPrivate; using namespace BPrivate;
/*!
\class MIMEManager /*! \class MIMEManager
\brief MIMEManager handles communication between BMimeType and the system-wide \brief MIMEManager handles communication between BMimeType and the system-wide
MimeDatabase object for BMimeType's write and non-atomic read functions. MimeDatabase object for BMimeType's write and non-atomic read functions.
*/ */
// constructor
/*! \brief Creates and initializes a MIMEManager. /*! \brief Creates and initializes a MIMEManager.
*/ */
MIMEManager::MIMEManager() MIMEManager::MIMEManager()
: BLooper("main_mime") :
, fDatabase() BLooper("main_mime"),
, fThreadManager() fDatabase(),
fThreadManager()
{ {
AddHandler(&fThreadManager); AddHandler(&fThreadManager);
@@ -48,14 +58,14 @@ MIMEManager::MIMEManager()
} }
} }
// destructor
/*! \brief Frees all resources associate with this object. /*! \brief Frees all resources associate with this object.
*/ */
MIMEManager::~MIMEManager() MIMEManager::~MIMEManager()
{ {
} }
// MessageReceived
/*! \brief Overrides the super class version to handle the MIME specific /*! \brief Overrides the super class version to handle the MIME specific
messages. messages.
\param message The message to be handled \param message The message to be handled
@@ -82,8 +92,8 @@ MIMEManager::MessageReceived(BMessage *message)
err = message->FindMessenger("target", &messenger); err = message->FindMessenger("target", &messenger);
if (!err) { if (!err) {
err = message->what == B_REG_MIME_START_WATCHING err = message->what == B_REG_MIME_START_WATCHING
? fDatabase.StartWatching(messenger) ? fDatabase.StartWatching(messenger)
: fDatabase.StopWatching(messenger); : fDatabase.StopWatching(messenger);
} }
reply.what = B_REG_RESULT; reply.what = B_REG_RESULT;
@@ -99,8 +109,7 @@ MIMEManager::MessageReceived(BMessage *message)
err = message->FindString("type", &type); err = message->FindString("type", &type);
if (!err) if (!err)
err = message->what == B_REG_MIME_INSTALL err = message->what == B_REG_MIME_INSTALL
? fDatabase.Install(type) ? fDatabase.Install(type) : fDatabase.Delete(type);
: fDatabase.Delete(type);
reply.what = B_REG_RESULT; reply.what = B_REG_RESULT;
reply.AddInt32("result", err); reply.AddInt32("result", err);
@@ -229,7 +238,7 @@ MIMEManager::MessageReceived(BMessage *message)
thread = new(nothrow) CreateAppMetaMimeThread( thread = new(nothrow) CreateAppMetaMimeThread(
synchronous ? "create_app_meta_mime (s)" synchronous ? "create_app_meta_mime (s)"
: "create_app_meta_mime (a)", : "create_app_meta_mime (a)",
B_NORMAL_PRIORITY, &fDatabase, B_NORMAL_PRIORITY + 1, &fDatabase,
BMessenger(&fThreadManager), &root, recursive, BMessenger(&fThreadManager), &root, recursive,
force, synchronous ? message : NULL); force, synchronous ? message : NULL);
break; break;
@@ -238,7 +247,7 @@ MIMEManager::MessageReceived(BMessage *message)
thread = new(nothrow) UpdateMimeInfoThread(synchronous thread = new(nothrow) UpdateMimeInfoThread(synchronous
? "update_mime_info (s)" ? "update_mime_info (s)"
: "update_mime_info (a)", : "update_mime_info (a)",
B_NORMAL_PRIORITY, &fDatabase, B_NORMAL_PRIORITY + 1, &fDatabase,
BMessenger(&fThreadManager), &root, recursive, BMessenger(&fThreadManager), &root, recursive,
force, synchronous ? message : NULL); force, synchronous ? message : NULL);
break; break;
@@ -289,7 +298,7 @@ MIMEManager::MessageReceived(BMessage *message)
} }
} }
// HandleSetParam
//! Handles all B_REG_MIME_SET_PARAM messages //! Handles all B_REG_MIME_SET_PARAM messages
void void
MIMEManager::HandleSetParam(BMessage *message) MIMEManager::HandleSetParam(BMessage *message)
@@ -328,10 +337,11 @@ MIMEManager::HandleSetParam(BMessage *message)
err = message->FindBool("long", &isLong); err = message->FindBool("long", &isLong);
if (!err) if (!err)
err = message->FindString("description", &description); err = message->FindString("description", &description);
if (!err) if (!err) {
err = (isLong err = isLong
? fDatabase.SetLongDescription(type, description) ? fDatabase.SetLongDescription(type, description)
: fDatabase.SetShortDescription(type, description)); : fDatabase.SetShortDescription(type, description);
}
break; break;
} }
@@ -350,25 +360,28 @@ MIMEManager::HandleSetParam(BMessage *message)
const void *data; const void *data;
ssize_t dataSize; ssize_t dataSize;
int32 size; int32 size;
err = message->FindData("icon data", B_RAW_TYPE, &data, &dataSize); err = message->FindData("icon data", B_RAW_TYPE, &data,
&dataSize);
if (!err) if (!err)
err = message->FindInt32("icon size", &size); err = message->FindInt32("icon size", &size);
if (which == B_REG_MIME_ICON_FOR_TYPE) { if (which == B_REG_MIME_ICON_FOR_TYPE) {
const char *fileType; const char *fileType;
if (!err) if (!err)
err = message->FindString("file type", &fileType); err = message->FindString("file type", &fileType);
if (!err) if (!err) {
err = size == -1 ? err = size == -1
fDatabase.SetIconForType(type, fileType, data, ? fDatabase.SetIconForType(type, fileType, data,
dataSize) : dataSize)
fDatabase.SetIconForType(type, fileType, data, : fDatabase.SetIconForType(type, fileType, data,
dataSize, (icon_size)size); dataSize, (icon_size)size);
}
} else { } else {
if (!err) if (!err) {
err = size == -1 ? err = size == -1
fDatabase.SetIcon(type, data, dataSize) : ? fDatabase.SetIcon(type, data, dataSize)
fDatabase.SetIcon(type, data, dataSize, : fDatabase.SetIcon(type, data, dataSize,
(icon_size)size); (icon_size)size);
}
} }
break; break;
// End temporary fix code // End temporary fix code
@@ -381,8 +394,10 @@ MIMEManager::HandleSetParam(BMessage *message)
err = message->FindString("signature", &signature); err = message->FindString("signature", &signature);
if (!err) if (!err)
err = message->FindInt32("app verb", &verb); err = message->FindInt32("app verb", &verb);
if (!err) if (!err) {
err = fDatabase.SetPreferredApp(type, signature, (app_verb)verb); err = fDatabase.SetPreferredApp(type, signature,
(app_verb)verb);
}
break; break;
} }
@@ -418,13 +433,11 @@ MIMEManager::HandleSetParam(BMessage *message)
message->SendReply(&reply, this); message->SendReply(&reply, this);
} }
// HandleSetParam
//! Handles all B_REG_MIME_SET_PARAM messages //! Handles all B_REG_MIME_SET_PARAM messages
void void
MIMEManager::HandleDeleteParam(BMessage *message) MIMEManager::HandleDeleteParam(BMessage *message)
{ {
// using BPrivate::MimeDatabase;
status_t err; status_t err;
int32 which; int32 which;
const char *type; const char *type;
@@ -446,10 +459,11 @@ MIMEManager::HandleDeleteParam(BMessage *message)
{ {
bool isLong; bool isLong;
err = message->FindBool("long", &isLong); err = message->FindBool("long", &isLong);
if (!err) if (!err) {
err = isLong err = isLong
? fDatabase.DeleteLongDescription(type) ? fDatabase.DeleteLongDescription(type)
: fDatabase.DeleteShortDescription(type); : fDatabase.DeleteShortDescription(type);
}
break; break;
} }
@@ -466,15 +480,18 @@ MIMEManager::HandleDeleteParam(BMessage *message)
const char *fileType; const char *fileType;
if (!err) if (!err)
err = message->FindString("file type", &fileType); err = message->FindString("file type", &fileType);
if (!err) if (!err) {
err = (size == -1) ? err = size == -1
fDatabase.DeleteIconForType(type, fileType) : ? fDatabase.DeleteIconForType(type, fileType)
fDatabase.DeleteIconForType(type, fileType, (icon_size)size); : fDatabase.DeleteIconForType(type, fileType,
(icon_size)size);
}
} else { } else {
if (!err) if (!err) {
err = (size == -1) ? err = size == -1
fDatabase.DeleteIcon(type) : ? fDatabase.DeleteIcon(type)
fDatabase.DeleteIcon(type, (icon_size)size); : fDatabase.DeleteIcon(type, (icon_size)size);
}
} }
break; break;
} }
+1 -1
View File
@@ -509,7 +509,7 @@ MessageDeliverer::Init()
// spawn the deliverer thread // spawn the deliverer thread
fDelivererThread = spawn_thread(MessageDeliverer::_DelivererThreadEntry, fDelivererThread = spawn_thread(MessageDeliverer::_DelivererThreadEntry,
"message deliverer", B_NORMAL_PRIORITY, this); "message deliverer", B_NORMAL_PRIORITY + 1, this);
if (fDelivererThread < 0) if (fDelivererThread < 0)
return fDelivererThread; return fDelivererThread;
+16 -13
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2007, Haiku, Inc. All Rights Reserved. * Copyright 2001-2009, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -54,7 +54,8 @@ static const bigtime_t kRosterSanityEventInterval = 1000000LL;
error code. error code.
*/ */
Registrar::Registrar(status_t *error) Registrar::Registrar(status_t *error)
: BServer(kRegistrarSignature, false, error), :
BServer(kRegistrarSignature, false, error),
fRoster(NULL), fRoster(NULL),
fClipboardHandler(NULL), fClipboardHandler(NULL),
fMIMEManager(NULL), fMIMEManager(NULL),
@@ -65,9 +66,11 @@ Registrar::Registrar(status_t *error)
fAuthenticationManager(NULL) fAuthenticationManager(NULL)
{ {
FUNCTION_START(); FUNCTION_START();
set_thread_priority(find_thread(NULL), B_NORMAL_PRIORITY + 1);
} }
// destructor
/*! \brief Frees all resources associated with the registrar. /*! \brief Frees all resources associated with the registrar.
All registrar services, that haven't been shut down earlier, are All registrar services, that haven't been shut down earlier, are
@@ -93,7 +96,7 @@ Registrar::~Registrar()
FUNCTION_END(); FUNCTION_END();
} }
// MessageReceived
/*! \brief Overrides the super class version to dispatch roster specific /*! \brief Overrides the super class version to dispatch roster specific
messages. messages.
\param message The message to be handled \param message The message to be handled
@@ -114,7 +117,7 @@ Registrar::MessageReceived(BMessage *message)
} }
} }
// ReadyToRun
/*! \brief Overrides the super class version to initialize the registrar /*! \brief Overrides the super class version to initialize the registrar
services. services.
*/ */
@@ -164,14 +167,14 @@ Registrar::ReadyToRun()
// create and schedule the sanity message event // create and schedule the sanity message event
fSanityEvent = new MessageEvent(system_time() + kRosterSanityEventInterval, fSanityEvent = new MessageEvent(system_time() + kRosterSanityEventInterval,
this, B_REG_ROSTER_SANITY_EVENT); this, B_REG_ROSTER_SANITY_EVENT);
fSanityEvent->SetAutoDelete(false); fSanityEvent->SetAutoDelete(false);
fEventQueue->AddEvent(fSanityEvent); fEventQueue->AddEvent(fSanityEvent);
FUNCTION_END(); FUNCTION_END();
} }
// QuitRequested
/*! \brief Overrides the super class version to avoid termination of the /*! \brief Overrides the super class version to avoid termination of the
registrar until the system shutdown. registrar until the system shutdown.
*/ */
@@ -183,7 +186,7 @@ Registrar::QuitRequested()
return BApplication::QuitRequested(); return BApplication::QuitRequested();
} }
// GetEventQueue
/*! \brief Returns the registrar's event queue. /*! \brief Returns the registrar's event queue.
\return The registrar's event queue. \return The registrar's event queue.
*/ */
@@ -193,7 +196,7 @@ Registrar::GetEventQueue() const
return fEventQueue; return fEventQueue;
} }
// App
/*! \brief Returns the Registrar application object. /*! \brief Returns the Registrar application object.
\return The Registrar application object. \return The Registrar application object.
*/ */
@@ -203,7 +206,7 @@ Registrar::App()
return dynamic_cast<Registrar*>(be_app); return dynamic_cast<Registrar*>(be_app);
} }
// _MessageReceived
void void
Registrar::_MessageReceived(BMessage *message) Registrar::_MessageReceived(BMessage *message)
{ {
@@ -352,7 +355,7 @@ Registrar::_MessageReceived(BMessage *message)
} }
} }
// _HandleShutDown
/*! \brief Handle a shut down request message. /*! \brief Handle a shut down request message.
\param request The request to be handled. \param request The request to be handled.
*/ */
@@ -414,7 +417,7 @@ main()
// rename the main thread // rename the main thread
rename_thread(find_thread(NULL), kRosterThreadName); rename_thread(find_thread(NULL), kRosterThreadName);
PRINT(("app->Run()...\n")); PRINT(("app->Run()...\n"));
try { try {
app->Run(); app->Run();
@@ -427,7 +430,7 @@ PRINT(("app->Run()...\n"));
debugger("registrar main() caught unknown exception"); debugger("registrar main() caught unknown exception");
} }
PRINT(("delete app...\n")); PRINT(("delete app...\n"));
delete app; delete app;
FUNCTION_END(); FUNCTION_END();
+2 -2
View File
@@ -695,8 +695,8 @@ ShutdownProcess::Init(BMessage* request)
} }
// start the worker thread // start the worker thread
fWorker = spawn_thread(_WorkerEntry, "shutdown worker", B_NORMAL_PRIORITY, fWorker = spawn_thread(_WorkerEntry, "shutdown worker",
this); B_NORMAL_PRIORITY + 1, this);
if (fWorker < 0) { if (fWorker < 0) {
fRoster->RemoveWatcher(this); fRoster->RemoveWatcher(this);
fRoster->SetShuttingDown(false); fRoster->SetShuttingDown(false);
@@ -1,6 +1,6 @@
/* /*
* Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -182,14 +182,14 @@ IOScheduler::Init(const char* name)
strlcpy(buffer, name, sizeof(buffer)); strlcpy(buffer, name, sizeof(buffer));
strlcat(buffer, " scheduler", sizeof(buffer)); strlcat(buffer, " scheduler", sizeof(buffer));
fSchedulerThread = spawn_kernel_thread(&_SchedulerThread, buffer, fSchedulerThread = spawn_kernel_thread(&_SchedulerThread, buffer,
B_NORMAL_PRIORITY, (void *)this); B_NORMAL_PRIORITY + 2, (void *)this);
if (fSchedulerThread < B_OK) if (fSchedulerThread < B_OK)
return fSchedulerThread; return fSchedulerThread;
strlcpy(buffer, name, sizeof(buffer)); strlcpy(buffer, name, sizeof(buffer));
strlcat(buffer, " notifier", sizeof(buffer)); strlcat(buffer, " notifier", sizeof(buffer));
fRequestNotifierThread = spawn_kernel_thread(&_RequestNotifierThread, fRequestNotifierThread = spawn_kernel_thread(&_RequestNotifierThread,
buffer, B_NORMAL_PRIORITY, (void *)this); buffer, B_NORMAL_PRIORITY + 2, (void *)this);
if (fRequestNotifierThread < B_OK) if (fRequestNotifierThread < B_OK)
return fRequestNotifierThread; return fRequestNotifierThread;