MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / initializeOwner

Method initializeOwner

src/lock/lock.cpp:353–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351
352
353bool LockManager::initializeOwner(CheckStatusWrapper* statusVector,
354 LOCK_OWNER_T owner_id,
355 UCHAR owner_type,
356 SRQ_PTR* owner_handle)
357{
358/**************************************
359 *
360 * i n i t i a l i z e O w n e r
361 *
362 **************************************
363 *
364 * Functional description
365 * Initialize lock manager for the given owner, if not already done.
366 *
367 * Initialize an owner block in the lock manager, if not already
368 * initialized.
369 *
370 * Return the offset of the owner block through owner_handle.
371 *
372 * Return success or failure.
373 *
374 **************************************/
375 LOCK_TRACE(("LM::init (ownerid=%ld)\n", owner_id));
376
377 SRQ_PTR owner_offset = *owner_handle;
378
379 if (owner_offset)
380 {
381 LockTableGuard guard(this, FB_FUNCTION, owner_offset);
382
383 // If everything is already initialized, just bump the use count
384
385 own* const owner = (own*) SRQ_ABS_PTR(owner_offset);
386 owner->own_count++;
387 return true;
388 }
389
390 LockTableGuard guard(this, FB_FUNCTION, DUMMY_OWNER);
391
392 owner_offset = create_owner(statusVector, owner_id, owner_type);
393
394 if (owner_offset)
395 *owner_handle = owner_offset;
396
397 LOCK_TRACE(("LM::init done (%ld)\n", owner_offset));
398 return (owner_offset != 0);
399}
400
401
402void LockManager::shutdownOwner(thread_db* tdbb, SRQ_PTR* owner_handle)

Callers 1

LCK_initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected