mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +01:00
fixed posix build
This commit is contained in:
parent
40978e8aea
commit
19b903f0c5
@ -39,6 +39,8 @@
|
||||
|
||||
#include "../jrd/gdsassert.h"
|
||||
#include "../common/utils_proto.h"
|
||||
#include "../common/classes/locks.h"
|
||||
#include "../common/classes/init.h"
|
||||
#include "../jrd/constants.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
@ -652,4 +654,12 @@ Firebird::PathName get_process_name()
|
||||
return buffer;
|
||||
}
|
||||
|
||||
SLONG genReadOnlyId()
|
||||
{
|
||||
static Firebird::GlobalPtr<Firebird::Mutex> mutex;
|
||||
Firebird::MutexLockGuard guard(mutex);
|
||||
static SLONG cnt = 0;
|
||||
return ++cnt;
|
||||
}
|
||||
|
||||
} // namespace fb_utils
|
||||
|
@ -94,6 +94,7 @@ namespace fb_utils
|
||||
#endif
|
||||
|
||||
Firebird::PathName get_process_name();
|
||||
SLONG genReadOnlyId();
|
||||
} // namespace fb_utils
|
||||
|
||||
#endif // INCLUDE_UTILS_PROTO_H
|
||||
|
@ -69,6 +69,7 @@
|
||||
#endif
|
||||
|
||||
#include "../common/config/config.h"
|
||||
#include "../common/utils_proto.h"
|
||||
#include "../jrd/fil.h"
|
||||
#include "../jrd/jrd.h"
|
||||
#include "../jrd/pag.h"
|
||||
@ -929,7 +930,7 @@ SLONG PAG_attachment_id(thread_db* tdbb)
|
||||
/* Get new attachment id */
|
||||
|
||||
if (dbb->dbb_flags & DBB_read_only) {
|
||||
attachment->att_attachment_id = ++dbb->dbb_attachment_id;
|
||||
attachment->att_attachment_id = dbb->dbb_attachment_id + fb_utils::genReadOnlyId();
|
||||
}
|
||||
else {
|
||||
window.win_page = HEADER_PAGE_NUMBER;
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include "../jrd/jrd_proto.h"
|
||||
#include "../common/classes/ClumpletWriter.h"
|
||||
#include "../common/classes/TriState.h"
|
||||
#include "../common/utils_proto.h"
|
||||
#include "../lock/lock_proto.h"
|
||||
|
||||
|
||||
@ -2315,7 +2316,7 @@ static void retain_context(thread_db* tdbb, jrd_tra* transaction,
|
||||
new_number = bump_transaction_id(tdbb, &window);
|
||||
#else
|
||||
if (dbb->dbb_flags & DBB_read_only)
|
||||
new_number = ++dbb->dbb_next_transaction;
|
||||
new_number = dbb->dbb_next_transaction + fb_utils::genReadOnlyId();
|
||||
else {
|
||||
const header_page* header = bump_transaction_id(tdbb, &window);
|
||||
new_number = header->hdr_next_transaction;
|
||||
@ -2808,7 +2809,7 @@ static jrd_tra* transaction_start(thread_db* tdbb, jrd_tra* temp)
|
||||
|
||||
#else /* SUPERSERVER_V2 */
|
||||
if (dbb->dbb_flags & DBB_read_only) {
|
||||
number = ++dbb->dbb_next_transaction;
|
||||
number = dbb->dbb_next_transaction + fb_utils::genReadOnlyId();
|
||||
oldest = dbb->dbb_oldest_transaction;
|
||||
oldest_active = dbb->dbb_oldest_active;
|
||||
oldest_snapshot = dbb->dbb_oldest_snapshot;
|
||||
|
Loading…
Reference in New Issue
Block a user