mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Restored accidentailly committed to CORE-195 experimental changes
This commit is contained in:
parent
a14bd303ed
commit
aa91b84afa
@ -6658,9 +6658,6 @@ static ISC_STATUS shutdown_all()
|
||||
// that no threads will get in and try to access the data
|
||||
// structures we released here
|
||||
|
||||
void SCH_stop(void);
|
||||
SCH_stop();
|
||||
|
||||
thread_db thd_context;
|
||||
thread_db* tdbb = JRD_MAIN_set_thread_data(thd_context);
|
||||
|
||||
|
@ -378,16 +378,6 @@ THREAD SCH_current_thread(void)
|
||||
}
|
||||
|
||||
|
||||
static FB_THREAD_ID schStopped = 0;
|
||||
|
||||
void SCH_stop(void)
|
||||
{
|
||||
sch_mutex_lock(thread_mutex);
|
||||
schStopped = ThreadData::getId();
|
||||
sch_mutex_unlock(thread_mutex);
|
||||
}
|
||||
|
||||
|
||||
void SCH_enter(void)
|
||||
{
|
||||
/**************************************
|
||||
@ -421,28 +411,8 @@ void SCH_enter(void)
|
||||
|
||||
/* Get mutex on scheduler data structures to prevent tragic misunderstandings */
|
||||
|
||||
#ifdef MULTI_THREAD
|
||||
if (schStopped)
|
||||
{
|
||||
mStop:
|
||||
if (ThreadData::getId() != schStopped)
|
||||
{
|
||||
pthread_exit(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
sch_mutex_lock(thread_mutex);
|
||||
|
||||
#ifdef MULTI_THREAD
|
||||
if (schStopped)
|
||||
{
|
||||
sch_mutex_unlock(thread_mutex);
|
||||
goto mStop;
|
||||
}
|
||||
#endif
|
||||
|
||||
THREAD thread = alloc_thread();
|
||||
thread->thread_id = ThreadData::getId();
|
||||
|
||||
@ -496,25 +466,8 @@ void SCH_exit(void)
|
||||
active_thread = NULL;
|
||||
free_threads->thread_next = NULL;
|
||||
#else
|
||||
|
||||
if (schStopped)
|
||||
{
|
||||
mStop:
|
||||
if (ThreadData::getId() != schStopped)
|
||||
{
|
||||
pthread_exit(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sch_mutex_lock(thread_mutex);
|
||||
|
||||
if (schStopped)
|
||||
{
|
||||
sch_mutex_unlock(thread_mutex);
|
||||
goto mStop;
|
||||
}
|
||||
|
||||
ast_enable(); /* Reenable AST delivery */
|
||||
|
||||
THREAD thread = active_thread;
|
||||
|
Loading…
Reference in New Issue
Block a user