mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +01:00
Misc
This commit is contained in:
parent
c398168403
commit
7800060e22
@ -6622,7 +6622,7 @@ bool thread_db::checkCancelState(bool punt)
|
||||
{
|
||||
if ((!request ||
|
||||
!(request->getStatement()->flags &
|
||||
(JrdStatement::FLAG_INTERNAL | JrdStatement::FLAG_SYS_TRIGGER))) &&
|
||||
(JrdStatement::FLAG_INTERNAL | JrdStatement::FLAG_SYS_TRIGGER))) &&
|
||||
(!transaction || !(transaction->tra_flags & TRA_system)))
|
||||
{
|
||||
if (!punt)
|
||||
|
@ -229,15 +229,10 @@ public:
|
||||
if (!wait)
|
||||
return;
|
||||
|
||||
switch (lock->lck_type)
|
||||
if (lock->lck_type == LCK_tra)
|
||||
{
|
||||
case LCK_tra:
|
||||
m_tdbb->tdbb_flags &= ~TDBB_wait_cancel_disable;
|
||||
att->att_wait_lock = lock;
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@ -379,7 +374,7 @@ bool LCK_cancel_wait(Jrd::Attachment* attachment)
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Try to cancel waiting of attachment inside the LM
|
||||
* Try to cancel waiting of attachment inside the LM.
|
||||
*
|
||||
**************************************/
|
||||
Database *dbb = attachment->att_database;
|
||||
|
@ -363,8 +363,7 @@ string OPT_get_plan(thread_db* tdbb, const jrd_req* request, bool detailed)
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Returns a formatted textual plan for all
|
||||
* RecordSelExpr's in the specified request.
|
||||
* Returns a formatted textual plan for all RseNode's in the specified request.
|
||||
*
|
||||
**************************************/
|
||||
string plan;
|
||||
|
@ -127,7 +127,7 @@ void RecordSource::printInversion(thread_db* tdbb, const InversionNode* inversio
|
||||
}
|
||||
else
|
||||
{
|
||||
plan += (plan.length() ? ", " : "") + printName(tdbb, indexName.c_str());
|
||||
plan += (plan.hasData() ? ", " : "") + printName(tdbb, indexName.c_str());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -165,7 +165,7 @@ private:
|
||||
class DSQLParamsImpl : public Firebird::StackIface<TraceParams, FB_TRACE_PARAMS_VERSION>
|
||||
{
|
||||
public:
|
||||
DSQLParamsImpl(Firebird::MemoryPool &pool, const Firebird::Array<dsql_par*>* params) :
|
||||
DSQLParamsImpl(Firebird::MemoryPool& pool, const Firebird::Array<dsql_par*>* params) :
|
||||
m_params(params),
|
||||
m_descs(pool)
|
||||
{}
|
||||
@ -191,7 +191,7 @@ private:
|
||||
class TraceFailedSQLStatement : public Firebird::StackIface<TraceSQLStatement, FB_TRACE_SQL_VERSION>
|
||||
{
|
||||
public:
|
||||
TraceFailedSQLStatement(Firebird::string &text) :
|
||||
TraceFailedSQLStatement(Firebird::string& text) :
|
||||
m_text(text)
|
||||
{}
|
||||
|
||||
@ -334,7 +334,7 @@ private:
|
||||
class TraceInitInfoImpl : public Firebird::StackIface<TraceInitInfo, FB_TRACE_INIT_INFO_VERSION>
|
||||
{
|
||||
public:
|
||||
TraceInitInfoImpl(const Firebird::TraceSession &session, const Attachment* att,
|
||||
TraceInitInfoImpl(const Firebird::TraceSession& session, const Attachment* att,
|
||||
const char* filename) :
|
||||
m_session(session),
|
||||
m_trace_conn(att),
|
||||
|
@ -853,6 +853,7 @@ bool LockManager::cancelWait(SRQ_PTR owner_offset)
|
||||
post_wakeup(owner);
|
||||
|
||||
release_shmem(DUMMY_OWNER);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4033,7 +4034,7 @@ USHORT LockManager::wait_for_request(Database* database, lrq* request, SSHORT lc
|
||||
// !!! this will be changed to have no dependency on thread_db !!!
|
||||
const bool cancelled = JRD_get_thread_data()->checkCancelState(false);
|
||||
|
||||
if (cancelled || lck_wait < 0 && lock_timeout <= current_time)
|
||||
if (cancelled || (lck_wait < 0 && lock_timeout <= current_time))
|
||||
{
|
||||
// We're going to reject our lock - it's the callers responsibility
|
||||
// to do cleanup and make sure post_pending() is called to wakeup
|
||||
|
@ -5421,6 +5421,7 @@ void Worker::setState(const bool active)
|
||||
bool Worker::wakeUp()
|
||||
{
|
||||
MutexLockGuard reqQueGuard(request_que_mutex);
|
||||
|
||||
#ifdef _DEBUG
|
||||
int cnt = 0;
|
||||
for (server_req_t* req = request_que; req; req = req->req_next)
|
||||
@ -5437,6 +5438,7 @@ bool Worker::wakeUp()
|
||||
return true;
|
||||
|
||||
MutexLockGuard guard(m_mutex);
|
||||
|
||||
if (m_idleWorkers)
|
||||
{
|
||||
Worker* idle = m_idleWorkers;
|
||||
@ -5444,8 +5446,10 @@ bool Worker::wakeUp()
|
||||
idle->m_sem.release();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_cntAll >= ports_active + ports_pending)
|
||||
return true;
|
||||
|
||||
return (m_cntAll >= MAX_THREADS);
|
||||
}
|
||||
|
||||
@ -5513,7 +5517,7 @@ void Worker::start(USHORT flags)
|
||||
Thread::start(loopThread, (void*)(IPTR) flags, THREAD_medium);
|
||||
++m_cntAll;
|
||||
}
|
||||
catch(const Exception&)
|
||||
catch (const Exception&)
|
||||
{
|
||||
if (!m_cntAll)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user