mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 04:43:03 +01:00
Cleanup.
This commit is contained in:
parent
1595111fc4
commit
bff84e9e7a
@ -57,10 +57,11 @@
|
||||
#include "../common/classes/rwlock.h"
|
||||
|
||||
|
||||
int API_ROUTINE gds__thread_start(
|
||||
ThreadEntryPoint* entrypoint,
|
||||
void* arg,
|
||||
int priority, int flags, void* thd_id)
|
||||
int API_ROUTINE gds__thread_start(ThreadEntryPoint* entrypoint,
|
||||
void* arg,
|
||||
int priority,
|
||||
int /*flags*/,
|
||||
void* thd_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -75,7 +76,7 @@ int API_ROUTINE gds__thread_start(
|
||||
|
||||
int rc = 0;
|
||||
try {
|
||||
ThreadStart::start(entrypoint, arg, priority, flags, thd_id);
|
||||
ThreadStart::start(entrypoint, arg, priority, thd_id);
|
||||
}
|
||||
catch (const Firebird::status_exception& status) {
|
||||
rc = status.value()[1];
|
||||
@ -155,7 +156,6 @@ THREAD_ENTRY_DECLARE threadStart(THREAD_ENTRY_PARAM arg)
|
||||
void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void* arg,
|
||||
int priority_arg,
|
||||
int flags,
|
||||
void* thd_id)
|
||||
{
|
||||
/**************************************
|
||||
@ -243,7 +243,6 @@ void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void* arg,
|
||||
int priority_arg,
|
||||
int flags,
|
||||
void* thd_id)
|
||||
{
|
||||
/**************************************
|
||||
@ -280,7 +279,6 @@ void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void* arg,
|
||||
int priority_arg,
|
||||
int flags,
|
||||
void* thd_id)
|
||||
{
|
||||
/**************************************
|
||||
@ -323,8 +321,7 @@ void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
ThreadPriorityScheduler::Init();
|
||||
|
||||
ThreadPriorityScheduler* tps = FB_NEW(*getDefaultMemoryPool())
|
||||
ThreadPriorityScheduler(routine, arg,
|
||||
ThreadPriorityScheduler::adjustPriority(priority));
|
||||
ThreadPriorityScheduler(routine, arg, ThreadPriorityScheduler::adjustPriority(priority));
|
||||
#endif // THREAD_PSCHED
|
||||
|
||||
/* I have changed the CreateThread here to _beginthreadex() as using
|
||||
@ -342,10 +339,8 @@ void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
|
||||
SetThreadPriority(handle, priority);
|
||||
|
||||
if (! (flags & THREAD_wait))
|
||||
{
|
||||
ResumeThread(handle);
|
||||
}
|
||||
ResumeThread(handle);
|
||||
|
||||
if (thd_id)
|
||||
{
|
||||
*static_cast<HANDLE*>(thd_id) = handle;
|
||||
@ -362,7 +357,6 @@ void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void ThreadStart::start(ThreadEntryPoint* routine,
|
||||
void* arg,
|
||||
int priority_arg,
|
||||
int flags,
|
||||
void* thd_id)
|
||||
{
|
||||
/**************************************
|
||||
|
@ -42,11 +42,6 @@ const int THREAD_medium_low = 4;
|
||||
const int THREAD_low = 5;
|
||||
const int THREAD_critical = 6;
|
||||
|
||||
/* Thread option flags */
|
||||
|
||||
const int THREAD_ast = 1; /* Thread can/should run at ast level */
|
||||
const int THREAD_blast = 2; /* Blow away thread during exit handler */
|
||||
const int THREAD_wait = 4; /* Somebody will wait for thread exit */
|
||||
|
||||
/* Thread startup */
|
||||
|
||||
@ -60,11 +55,7 @@ class ThreadStart : public ThreadData
|
||||
public:
|
||||
explicit ThreadStart(ThreadData::ThreadDataType t) : ThreadData(t) { }
|
||||
|
||||
static void start(ThreadEntryPoint* routine,
|
||||
void* arg,
|
||||
int priority_arg,
|
||||
int flags,
|
||||
void* thd_id);
|
||||
static void start(ThreadEntryPoint* routine, void* arg, int priority_arg, void* thd_id);
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
@ -670,7 +670,7 @@ static SLONG create_process(void)
|
||||
probe_processes();
|
||||
release();
|
||||
|
||||
if (gds__thread_start(watcher_thread, NULL, THREAD_medium, THREAD_blast, 0))
|
||||
if (gds__thread_start(watcher_thread, NULL, THREAD_medium, 0, 0))
|
||||
ERR_bugcheck_msg("cannot start thread");
|
||||
|
||||
return EVENT_process_offset;
|
||||
|
@ -3162,7 +3162,7 @@ int GDS_SHUTDOWN(unsigned int timeout)
|
||||
{
|
||||
Firebird::Semaphore shutdown_semaphore;
|
||||
|
||||
ThreadStart::start(shutdown_thread, &shutdown_semaphore, THREAD_medium, 0, 0);
|
||||
ThreadStart::start(shutdown_thread, &shutdown_semaphore, THREAD_medium, 0);
|
||||
|
||||
if (!shutdown_semaphore.tryEnter(0, timeout))
|
||||
{
|
||||
|
@ -3126,8 +3126,7 @@ ISC_STATUS GDS_QUE_EVENTS(ISC_STATUS* user_status,
|
||||
return user_status[1];
|
||||
}
|
||||
|
||||
gds__thread_start(event_thread, port->port_async,
|
||||
THREAD_high, THREAD_ast, 0);
|
||||
gds__thread_start(event_thread, port->port_async, THREAD_high, 0, 0);
|
||||
|
||||
port->port_async->port_context = rdb;
|
||||
}
|
||||
|
@ -575,8 +575,7 @@ void SRVR_multi_thread( rem_port* main_port, USHORT flags)
|
||||
fflush(stdout);
|
||||
#endif
|
||||
if (!shutting_down && !Worker::wakeUp()) {
|
||||
gds__thread_start(loopThread, (void*)(IPTR) flags,
|
||||
THREAD_medium, THREAD_ast, 0);
|
||||
gds__thread_start(loopThread, (void*)(IPTR) flags, THREAD_medium, 0, 0);
|
||||
}
|
||||
}
|
||||
request = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user